diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 000000000..12007344c --- /dev/null +++ b/.fern/metadata.json @@ -0,0 +1,15 @@ +{ + "cliVersion": "3.31.1", + "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/.fernignore b/.fernignore index a54fbc537..308317f74 100644 --- a/.fernignore +++ b/.fernignore @@ -15,3 +15,4 @@ src/main/java/com/merge/legacy src/main/java/com/merge/api/core/QueryStringMapper.java src/test/java/com/merge/api/integration/CursorPaginationIntegrationTest.java +changelog.md 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..b98d3569b 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/). @@ -29,7 +48,7 @@ Add the dependency in your `pom.xml` file: dev.merge merge-java-client - 5.0.1 + 5.0.2 ``` @@ -80,7 +99,7 @@ MergeApiClient client = MergeApiClient .builder() .build(); -client.ats().accountDetails().retrieve(...); +client.ats().candidates().ignoreCreate(...); ``` ## Environments @@ -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 { - client.ats().accountDetails().retrieve(...); -} catch (ApiError e) { +try{ + client.ats().candidates().ignoreCreate(...); +} 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: @@ -181,7 +202,7 @@ MergeApiClient client = MergeApiClient .build(); // Request level -client.ats().accountDetails().retrieve( +client.ats().candidates().ignoreCreate( ..., RequestOptions .builder() @@ -207,7 +228,7 @@ MergeApiClient client = MergeApiClient ; // Request level -client.ats().accountDetails().retrieve( +client.ats().candidates().ignoreCreate( ..., RequestOptions .builder() @@ -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 +IgnoreCreateHttpResponse response = client.ats().candidates().withRawResponse().ignoreCreate(...); + +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..98ef7bcb2 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.0.2' jar { dependsOn(":generatePomFileForMavenPublication") @@ -79,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'dev.merge' artifactId = 'merge-java-client' - version = '5.0.1' + version = '5.0.2' from components.java pom { name = 'merge' diff --git a/changelog.md b/changelog.md new file mode 100644 index 000000000..61dc3d9a7 --- /dev/null +++ b/changelog.md @@ -0,0 +1,4 @@ +## 5.0.2 - 2026-01-16 +* SDK regeneration +* Unable to analyze changes with AI, incrementing PATCH version. + diff --git a/src/main/java/com/merge/api/accounting/AccountTokenClient.java b/src/main/java/com/merge/api/accounting/AccountTokenClient.java index e1bd0ccb9..9a1e2038a 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.AccountTokenRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java b/src/main/java/com/merge/api/accounting/AsyncAccountTokenClient.java index 6bdc8b349..cb240fd52 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.AccountTokenRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import java.util.concurrent.CompletableFuture; @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java index 1db96ec19..44f1eec49 100644 --- a/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncAsyncPassthroughClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveRequest; import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; import com.merge.api.accounting.types.DataPassthroughRequest; import com.merge.api.core.ClientOptions; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java index 979717c37..8c3618a05 100644 --- a/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncAsyncTasksClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.accounting.types.AsyncTasksRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import java.util.concurrent.CompletableFuture; @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String id) { /** * Returns an AsyncPostTask object with the given id. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, AsyncTasksRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture retrieve( + String id, AsyncTasksRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java index 2ea328578..91a461c6e 100644 --- a/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncFieldMappingClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsDestroyRequest; import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; import com.merge.api.accounting.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java index 897b611c4..fce513f7b 100644 --- a/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncInvoicesClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesMetaPatchRetrieveRequest; import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; @@ -145,8 +146,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Invoice PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, InvoicesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, InvoicesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java b/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java index 86facea3a..18983c6d2 100644 --- a/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.accounting.types.Issue; import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.IssuesRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/accounting/AsyncItemsClient.java b/src/main/java/com/merge/api/accounting/AsyncItemsClient.java index b07b348f1..497fe4093 100644 --- a/src/main/java/com/merge/api/accounting/AsyncItemsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncItemsClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ItemEndpointRequest; import com.merge.api.accounting.types.ItemResponse; import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.ItemsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PatchedItemEndpointRequest; @@ -113,8 +114,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Item PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, ItemsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Item PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, ItemsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java b/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java index 7349da1c7..c084f15af 100644 --- a/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncPaymentsClient.java @@ -10,6 +10,7 @@ import com.merge.api.accounting.types.PaymentResponse; import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsRetrieveRequest; import com.merge.api.accounting.types.RemoteFieldClass; @@ -143,8 +144,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Payment PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, PaymentsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, PaymentsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, 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..e512414e4 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.AccountTokenRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..2a7b7b5ca 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountingPeriodsClient.java @@ -18,7 +18,6 @@ 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; @@ -103,10 +102,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountingPeriodList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() .from(request) .cursor(startingAfter) @@ -115,7 +115,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -127,12 +127,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 +194,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..ae3d8dbe3 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAccountsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -160,10 +157,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -171,7 +169,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -183,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)); @@ -226,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); } @@ -251,18 +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(), 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 +329,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 +382,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..5457608eb 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncPassthroughClient.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveRequest; import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; import com.merge.api.accounting.types.DataPassthroughRequest; import com.merge.api.core.ApiError; @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..a2127956f 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAsyncTasksClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.accounting.types.AsyncTasksRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -33,24 +34,33 @@ public AsyncRawAsyncTasksClient(ClientOptions clientOptions) { * Returns an AsyncPostTask object with the given id. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, AsyncTasksRetrieveRequest.builder().build()); } /** * Returns an AsyncPostTask object with the given id. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, AsyncTasksRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public CompletableFuture> retrieve( + String id, AsyncTasksRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/async-tasks") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -60,18 +70,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..2c2accdb1 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAttachmentsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -134,10 +131,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountingAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -146,7 +144,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -158,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)); @@ -202,12 +197,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 +220,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 +295,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 +349,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..7918e7334 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..29c40a53f 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBalanceSheetsClient.java @@ -18,7 +18,6 @@ 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; @@ -130,10 +129,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedBalanceSheetList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() .from(request) .cursor(startingAfter) @@ -141,7 +141,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -153,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)); @@ -227,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(), 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..c486155c4 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedAccountsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -109,10 +106,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedBankFeedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -121,7 +119,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -133,12 +131,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 +172,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 +195,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 +269,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 +323,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..22f7a3f7c 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawBankFeedTransactionsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -138,10 +135,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedBankFeedTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +148,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); @@ -206,12 +201,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 +224,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 +303,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 +357,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..80e99bad9 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCashFlowStatementsClient.java @@ -18,7 +18,6 @@ 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; @@ -131,10 +130,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedCashFlowStatementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() .from(request) .cursor(startingAfter) @@ -143,7 +143,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -155,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)); @@ -229,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(), 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..5ceb70f31 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCompanyInfoClient.java @@ -18,7 +18,6 @@ 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; @@ -126,10 +125,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCompanyInfoList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyInfoList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() .from(request) .cursor(startingAfter) @@ -137,7 +137,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -149,12 +149,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 +220,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..73abac669 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawContactsClient.java @@ -24,10 +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; import okhttp3.Call; @@ -174,10 +171,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) @@ -185,7 +183,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -197,12 +195,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 +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); } @@ -265,18 +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(), 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 +350,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)); @@ -414,18 +403,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,10 +503,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) @@ -530,7 +517,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -542,12 +529,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..2b2c6691a 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawCreditNotesClient.java @@ -21,10 +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; import okhttp3.Call; @@ -159,10 +156,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCreditNoteList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCreditNoteList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CreditNotesListRequest nextRequest = CreditNotesListRequest.builder() .from(request) .cursor(startingAfter) @@ -170,7 +168,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -182,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 +220,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 +243,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 +328,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(), CreditNote.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNote.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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 +381,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..c51b48c8a 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawEmployeesClient.java @@ -18,7 +18,6 @@ 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; @@ -105,10 +104,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) .cursor(startingAfter) @@ -116,7 +116,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -128,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)); @@ -201,17 +198,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/AsyncRawExpensesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java index a7cb5375a..90ffbb221 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawExpensesClient.java @@ -25,10 +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; import okhttp3.Call; @@ -161,10 +158,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesListRequest nextRequest = ExpensesListRequest.builder() .from(request) .cursor(startingAfter) @@ -172,7 +170,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -184,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)); @@ -227,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); } @@ -252,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(), 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 +329,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(), Expense.class), response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Expense.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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,10 +429,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesLinesRemoteFieldClassesListRequest nextRequest = ExpensesLinesRemoteFieldClassesListRequest.builder() .from(request) @@ -453,7 +443,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return linesRemoteFieldClassesList(nextRequest, requestOptions) .get() @@ -465,12 +455,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 +502,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,10 +602,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesRemoteFieldClassesListRequest nextRequest = ExpensesRemoteFieldClassesListRequest.builder() .from(request) @@ -631,7 +616,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -643,12 +628,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..03349c9ca 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawFieldMappingClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsDestroyRequest; import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; import com.merge.api.accounting.types.RemoteFieldApiResponse; @@ -21,8 +22,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 +86,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 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -304,19 +299,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 +373,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 +428,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..0f64aba64 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawGeneralLedgerTransactionsClient.java @@ -18,7 +18,6 @@ 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; @@ -139,10 +138,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedGeneralLedgerTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); GeneralLedgerTransactionsListRequest nextRequest = GeneralLedgerTransactionsListRequest.builder() .from(request) @@ -152,7 +152,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -164,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)); @@ -238,19 +235,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..bc3282611 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawIncomeStatementsClient.java @@ -18,7 +18,6 @@ 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; @@ -130,10 +129,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedIncomeStatementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() .from(request) .cursor(startingAfter) @@ -142,7 +142,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -154,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)); @@ -228,18 +225,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..d50dd1a58 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawInvoicesClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesMetaPatchRetrieveRequest; import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; @@ -26,10 +27,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; import okhttp3.Call; @@ -180,10 +178,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedInvoiceList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesListRequest nextRequest = InvoicesListRequest.builder() .from(request) .cursor(startingAfter) @@ -191,7 +190,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -203,12 +202,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 +244,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 +267,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 +359,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 +407,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 +430,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(), 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)); @@ -547,10 +533,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = InvoicesLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -560,7 +547,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) .get() @@ -572,12 +559,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)); @@ -596,25 +580,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Invoice PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, InvoicesMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, InvoicesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Invoice PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, InvoicesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/invoices/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -624,18 +616,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 +669,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,10 +769,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesRemoteFieldClassesListRequest nextRequest = InvoicesRemoteFieldClassesListRequest.builder() .from(request) @@ -796,7 +783,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -808,12 +795,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..664c8d2bf 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.accounting.types.Issue; import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.IssuesRetrieveRequest; import com.merge.api.accounting.types.PaginatedIssueList; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -17,7 +18,6 @@ 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; @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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/AsyncRawItemsClient.java b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java index f9d7934ce..f028b2e49 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawItemsClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ItemEndpointRequest; import com.merge.api.accounting.types.ItemResponse; import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.ItemsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedItemList; @@ -22,10 +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; import okhttp3.Call; @@ -145,17 +143,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedItemList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ItemsListRequest nextRequest = ItemsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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,12 +206,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 +229,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 +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(), 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 +361,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 +384,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)); @@ -427,25 +411,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Item PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, ItemsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Item PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, ItemsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Item PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, ItemsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/items/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -455,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)); @@ -511,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)); diff --git a/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java index 9687e9388..49f2c08db 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawJournalEntriesClient.java @@ -25,10 +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; import okhttp3.Call; @@ -162,10 +159,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedJournalEntryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -173,7 +171,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -185,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)); @@ -228,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); } @@ -253,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(), 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 +331,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,10 +431,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = JournalEntriesLinesRemoteFieldClassesListRequest.builder() .from(request) @@ -456,7 +445,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return linesRemoteFieldClassesList(nextRequest, requestOptions) .get() @@ -468,12 +457,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 +504,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,10 +604,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesRemoteFieldClassesListRequest nextRequest = JournalEntriesRemoteFieldClassesListRequest.builder() .from(request) @@ -634,7 +618,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -646,12 +630,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..f56c31333 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkTokenClient.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(), 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..034e3f2e3 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -138,10 +137,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); 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..a503557d8 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentMethodsClient.java @@ -18,7 +18,6 @@ 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; @@ -102,10 +101,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedPaymentMethodList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() .from(request) .cursor(startingAfter) @@ -113,7 +113,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -125,12 +125,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 +192,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..6422a394a 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentTermsClient.java @@ -18,7 +18,6 @@ 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; @@ -106,10 +105,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedPaymentTermList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentTermList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() .from(request) .cursor(startingAfter) @@ -117,7 +117,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -129,12 +129,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 +200,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..a82f47c40 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPaymentsClient.java @@ -12,6 +12,7 @@ import com.merge.api.accounting.types.PaymentResponse; import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsRetrieveRequest; import com.merge.api.accounting.types.RemoteFieldClass; @@ -26,10 +27,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; import okhttp3.Call; @@ -170,10 +168,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsListRequest nextRequest = PaymentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -181,7 +180,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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,10 +513,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = PaymentsLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -540,7 +527,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) .get() @@ -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)); @@ -576,25 +560,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Payment PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, PaymentsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, PaymentsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Payment PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, PaymentsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/payments/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -604,18 +596,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 +649,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,10 +749,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsRemoteFieldClassesListRequest nextRequest = PaymentsRemoteFieldClassesListRequest.builder() .from(request) @@ -776,7 +763,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -788,12 +775,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..e3fc1e7ca 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawProjectsClient.java @@ -100,18 +100,16 @@ 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()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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 +177,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..291396068 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawPurchaseOrdersClient.java @@ -25,10 +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; import okhttp3.Call; @@ -164,10 +161,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedPurchaseOrderList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() .from(request) .cursor(startingAfter) @@ -175,7 +173,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -187,12 +185,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 +225,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 +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(), 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 +341,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,10 +444,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -468,7 +458,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return lineItemsRemoteFieldClassesList(nextRequest, requestOptions) .get() @@ -480,12 +470,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 +517,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,10 +617,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersRemoteFieldClassesListRequest nextRequest = PurchaseOrdersRemoteFieldClassesListRequest.builder() .from(request) @@ -646,7 +631,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -658,12 +643,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/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..a68052788 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -82,10 +81,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) .cursor(startingAfter) @@ -93,7 +93,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -105,12 +105,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..99ff3bcfb 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTaxRatesClient.java @@ -18,7 +18,6 @@ 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; @@ -133,10 +132,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaxRateList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() .from(request) .cursor(startingAfter) @@ -144,7 +144,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -156,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,17 +226,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..a11d9b71b 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTrackingCategoriesClient.java @@ -18,7 +18,6 @@ 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; @@ -151,10 +150,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedTrackingCategoryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -163,7 +163,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -175,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)); @@ -257,18 +254,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..59a692432 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawTransactionsClient.java @@ -18,7 +18,6 @@ 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; @@ -144,10 +143,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedTransactionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TransactionsListRequest nextRequest = TransactionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -155,7 +155,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -167,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)); @@ -241,18 +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(), 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..dac57f908 100644 --- a/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncRawVendorCreditsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -151,10 +148,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedVendorCreditList.class); + String startingAfter = parsedResponse.getNext().orElse(null); VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() .from(request) .cursor(startingAfter) @@ -162,7 +160,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -174,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)); @@ -217,12 +212,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 +235,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 +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(), VendorCredit.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCredit.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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 +366,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/AsyncTasksClient.java b/src/main/java/com/merge/api/accounting/AsyncTasksClient.java index 52421952f..c7caefe86 100644 --- a/src/main/java/com/merge/api/accounting/AsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/AsyncTasksClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.accounting.types.AsyncTasksRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -34,7 +35,14 @@ public AsyncPostTask retrieve(String id) { /** * Returns an AsyncPostTask object with the given id. */ - public AsyncPostTask retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public AsyncPostTask retrieve(String id, AsyncTasksRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public AsyncPostTask retrieve(String id, AsyncTasksRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/accounting/FieldMappingClient.java b/src/main/java/com/merge/api/accounting/FieldMappingClient.java index 76455491a..240b4cfc2 100644 --- a/src/main/java/com/merge/api/accounting/FieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/FieldMappingClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsDestroyRequest; import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; import com.merge.api.accounting.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/accounting/InvoicesClient.java b/src/main/java/com/merge/api/accounting/InvoicesClient.java index 92d062d6c..9bc8b833f 100644 --- a/src/main/java/com/merge/api/accounting/InvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/InvoicesClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesMetaPatchRetrieveRequest; import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; @@ -142,8 +143,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Invoice PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, InvoicesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, InvoicesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/accounting/IssuesClient.java b/src/main/java/com/merge/api/accounting/IssuesClient.java index 33c7bfedc..d8e8f5cc9 100644 --- a/src/main/java/com/merge/api/accounting/IssuesClient.java +++ b/src/main/java/com/merge/api/accounting/IssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.accounting.types.Issue; import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.IssuesRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/accounting/ItemsClient.java b/src/main/java/com/merge/api/accounting/ItemsClient.java index 24f1c9a8e..acd9b3ae0 100644 --- a/src/main/java/com/merge/api/accounting/ItemsClient.java +++ b/src/main/java/com/merge/api/accounting/ItemsClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ItemEndpointRequest; import com.merge.api.accounting.types.ItemResponse; import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.ItemsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PatchedItemEndpointRequest; @@ -111,8 +112,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Item PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, ItemsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Item PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, ItemsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/accounting/PaymentsClient.java b/src/main/java/com/merge/api/accounting/PaymentsClient.java index 6746abe0b..b1f87f7a2 100644 --- a/src/main/java/com/merge/api/accounting/PaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/PaymentsClient.java @@ -10,6 +10,7 @@ import com.merge.api.accounting.types.PaymentResponse; import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsRetrieveRequest; import com.merge.api.accounting.types.RemoteFieldClass; @@ -140,8 +141,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Payment PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, PaymentsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, PaymentsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, 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..632367093 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.AccountTokenRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..34687019d 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountingPeriodsClient.java @@ -18,7 +18,6 @@ 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; @@ -93,10 +92,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountingPeriodList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountingPeriodsListRequest nextRequest = AccountingPeriodsListRequest.builder() .from(request) .cursor(startingAfter) @@ -104,17 +104,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -166,16 +162,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..e05d04926 100644 --- a/src/main/java/com/merge/api/accounting/RawAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAccountsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -152,27 +149,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -200,12 +194,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 +214,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 +284,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 +323,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..3aaa4be90 100644 --- a/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/accounting/RawAsyncPassthroughClient.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.accounting.types.AsyncPassthroughReciept; +import com.merge.api.accounting.types.AsyncPassthroughRetrieveRequest; import com.merge.api.accounting.types.AsyncPassthroughRetrieveResponse; import com.merge.api.accounting.types.DataPassthroughRequest; import com.merge.api.core.ApiError; @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..e35f57460 100644 --- a/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java +++ b/src/main/java/com/merge/api/accounting/RawAsyncTasksClient.java @@ -4,6 +4,7 @@ package com.merge.api.accounting; import com.merge.api.accounting.types.AsyncPostTask; +import com.merge.api.accounting.types.AsyncTasksRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -29,40 +30,45 @@ public RawAsyncTasksClient(ClientOptions clientOptions) { * Returns an AsyncPostTask object with the given id. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, AsyncTasksRetrieveRequest.builder().build()); } /** * Returns an AsyncPostTask object with the given id. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String id, AsyncTasksRetrieveRequest request) { + return retrieve(id, request, null); + } + + /** + * Returns an AsyncPostTask object with the given id. + */ + public MergeApiHttpResponse retrieve( + String id, AsyncTasksRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/async-tasks") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..44d7632bc 100644 --- a/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/accounting/RawAttachmentsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -124,10 +121,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountingAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -135,17 +133,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -174,12 +168,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 +188,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 +247,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 +286,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..259eb43ba 100644 --- a/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/accounting/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..ad6681657 100644 --- a/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBalanceSheetsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBalanceSheetList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BalanceSheetsListRequest nextRequest = BalanceSheetsListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,17 +132,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -198,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(), 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..543c2d016 100644 --- a/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBankFeedAccountsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -100,10 +97,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankFeedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankFeedAccountsListRequest nextRequest = BankFeedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -111,17 +109,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -150,12 +144,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 +164,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 +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(), 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 +262,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..0139a347c 100644 --- a/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawBankFeedTransactionsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -128,10 +125,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedBankFeedTransactionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankFeedTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankFeedTransactionsListRequest nextRequest = BankFeedTransactionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -139,17 +137,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -178,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); } @@ -200,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(), 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 +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(), 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 +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/accounting/RawCashFlowStatementsClient.java b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java index 34cdc0093..2248fd8d8 100644 --- a/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/RawCashFlowStatementsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCashFlowStatementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCashFlowStatementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CashFlowStatementsListRequest nextRequest = CashFlowStatementsListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,17 +132,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -198,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(), 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..750e99096 100644 --- a/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java +++ b/src/main/java/com/merge/api/accounting/RawCompanyInfoClient.java @@ -18,7 +18,6 @@ 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; @@ -117,10 +116,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyInfoList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CompanyInfoListRequest nextRequest = CompanyInfoListRequest.builder() .from(request) .cursor(startingAfter) @@ -128,17 +128,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -194,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(), 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..cfe1fe8f1 100644 --- a/src/main/java/com/merge/api/accounting/RawContactsClient.java +++ b/src/main/java/com/merge/api/accounting/RawContactsClient.java @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -166,27 +163,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -214,12 +208,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 +228,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 +305,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); } @@ -358,16 +344,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,10 +429,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -457,17 +441,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/accounting/RawCreditNotesClient.java b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java index a5dda9f34..58dbb5cdf 100644 --- a/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java +++ b/src/main/java/com/merge/api/accounting/RawCreditNotesClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -150,28 +147,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCreditNoteList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CreditNotesListRequest nextRequest = CreditNotesListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -200,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); } @@ -222,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(), 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 +283,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(), CreditNote.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreditNote.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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 +322,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..edd3cce0f 100644 --- a/src/main/java/com/merge/api/accounting/RawEmployeesClient.java +++ b/src/main/java/com/merge/api/accounting/RawEmployeesClient.java @@ -18,7 +18,6 @@ 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; @@ -97,27 +96,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -173,16 +169,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/RawExpensesClient.java b/src/main/java/com/merge/api/accounting/RawExpensesClient.java index e23eae6fb..94213153b 100644 --- a/src/main/java/com/merge/api/accounting/RawExpensesClient.java +++ b/src/main/java/com/merge/api/accounting/RawExpensesClient.java @@ -25,10 +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; import okhttp3.OkHttpClient; @@ -153,27 +150,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedExpenseList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesListRequest nextRequest = ExpensesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -201,12 +195,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 +215,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 +284,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(), Expense.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Expense.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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,10 +369,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesLinesRemoteFieldClassesListRequest nextRequest = ExpensesLinesRemoteFieldClassesListRequest.builder() .from(request) @@ -395,17 +382,13 @@ public MergeApiHttpResponse> linesRemoteFie List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> linesRemoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> linesRemoteFieldClassesList( 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); } @@ -438,16 +421,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,10 +506,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ExpensesRemoteFieldClassesListRequest nextRequest = ExpensesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -537,17 +518,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/accounting/RawFieldMappingClient.java b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java index 008716ff4..082c152c3 100644 --- a/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/accounting/RawFieldMappingClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.ExternalTargetFieldApiResponse; import com.merge.api.accounting.types.FieldMappingApiInstanceResponse; import com.merge.api.accounting.types.FieldMappingInstanceResponse; +import com.merge.api.accounting.types.FieldMappingsDestroyRequest; import com.merge.api.accounting.types.FieldMappingsRetrieveRequest; import com.merge.api.accounting.types.PatchedEditFieldMappingRequest; import com.merge.api.accounting.types.RemoteFieldApiResponse; @@ -21,8 +22,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 +79,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 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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 +302,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 +342,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..23610041c 100644 --- a/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawGeneralLedgerTransactionsClient.java @@ -18,7 +18,6 @@ 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; @@ -130,10 +129,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedGeneralLedgerTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); GeneralLedgerTransactionsListRequest nextRequest = GeneralLedgerTransactionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -142,17 +142,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -209,17 +205,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..6b5bf5107 100644 --- a/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java +++ b/src/main/java/com/merge/api/accounting/RawIncomeStatementsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIncomeStatementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); IncomeStatementsListRequest nextRequest = IncomeStatementsListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,17 +132,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -198,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(), 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..853a93dda 100644 --- a/src/main/java/com/merge/api/accounting/RawInvoicesClient.java +++ b/src/main/java/com/merge/api/accounting/RawInvoicesClient.java @@ -8,6 +8,7 @@ import com.merge.api.accounting.types.InvoiceResponse; import com.merge.api.accounting.types.InvoicesLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesListRequest; +import com.merge.api.accounting.types.InvoicesMetaPatchRetrieveRequest; import com.merge.api.accounting.types.InvoicesRemoteFieldClassesListRequest; import com.merge.api.accounting.types.InvoicesRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; @@ -26,10 +27,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; import okhttp3.OkHttpClient; @@ -172,27 +170,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedInvoiceList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesListRequest nextRequest = InvoicesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -222,12 +217,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 +237,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 +314,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 +350,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 +370,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(), 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); } @@ -473,10 +455,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesLineItemsRemoteFieldClassesListRequest nextRequest = InvoicesLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -485,19 +468,13 @@ public MergeApiHttpResponse> lineItemsRemot List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), - result, - parsedResponse, - () -> lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + !startingAfter.isEmpty(), result, parsedResponse, () -> lineItemsRemoteFieldClassesList( + 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); } @@ -507,40 +484,45 @@ public MergeApiHttpResponse> lineItemsRemot * Returns metadata for Invoice PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, InvoicesMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Invoice PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, InvoicesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Invoice PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, InvoicesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/invoices/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +555,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,10 +640,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InvoicesRemoteFieldClassesListRequest nextRequest = InvoicesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -672,17 +652,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/accounting/RawIssuesClient.java b/src/main/java/com/merge/api/accounting/RawIssuesClient.java index dd539b014..4acd5aeaf 100644 --- a/src/main/java/com/merge/api/accounting/RawIssuesClient.java +++ b/src/main/java/com/merge/api/accounting/RawIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.accounting.types.Issue; import com.merge.api.accounting.types.IssuesListRequest; +import com.merge.api.accounting.types.IssuesRetrieveRequest; import com.merge.api.accounting.types.PaginatedIssueList; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -17,7 +18,6 @@ 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; @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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/RawItemsClient.java b/src/main/java/com/merge/api/accounting/RawItemsClient.java index 4d1d34d78..b34a9af13 100644 --- a/src/main/java/com/merge/api/accounting/RawItemsClient.java +++ b/src/main/java/com/merge/api/accounting/RawItemsClient.java @@ -7,6 +7,7 @@ import com.merge.api.accounting.types.ItemEndpointRequest; import com.merge.api.accounting.types.ItemResponse; import com.merge.api.accounting.types.ItemsListRequest; +import com.merge.api.accounting.types.ItemsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.ItemsRetrieveRequest; import com.merge.api.accounting.types.MetaResponse; import com.merge.api.accounting.types.PaginatedItemList; @@ -22,10 +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; import okhttp3.OkHttpClient; @@ -137,27 +135,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedItemList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ItemsListRequest nextRequest = ItemsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -185,12 +180,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 +200,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 +269,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 +305,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 +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(), 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); } @@ -359,40 +341,45 @@ public MergeApiHttpResponse partialUpdate( * Returns metadata for Item PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, ItemsMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Item PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve(String id, ItemsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Item PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve( + String id, ItemsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/items/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +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); } diff --git a/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java index d71523312..866214a0d 100644 --- a/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java +++ b/src/main/java/com/merge/api/accounting/RawJournalEntriesClient.java @@ -25,10 +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; import okhttp3.OkHttpClient; @@ -153,10 +150,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJournalEntryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesListRequest nextRequest = JournalEntriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -164,17 +162,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -203,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); } @@ -225,17 +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(), 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 +286,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,10 +371,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesLinesRemoteFieldClassesListRequest nextRequest = JournalEntriesLinesRemoteFieldClassesListRequest.builder() .from(request) @@ -398,17 +384,13 @@ public MergeApiHttpResponse> linesRemoteFie List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> linesRemoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> linesRemoteFieldClassesList( 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); } @@ -441,16 +423,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,10 +508,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JournalEntriesRemoteFieldClassesListRequest nextRequest = JournalEntriesRemoteFieldClassesListRequest.builder() .from(request) @@ -541,17 +521,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/accounting/RawLinkTokenClient.java b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java index 42a8e1320..de456c816 100644 --- a/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/accounting/RawLinkTokenClient.java @@ -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..5ec650647 100644 --- a/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/accounting/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..67fcc6941 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentMethodsClient.java @@ -18,7 +18,6 @@ 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; @@ -93,10 +92,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentMethodList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentMethodsListRequest nextRequest = PaymentMethodsListRequest.builder() .from(request) .cursor(startingAfter) @@ -104,17 +104,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -166,16 +162,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..21914721e 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentTermsClient.java @@ -18,7 +18,6 @@ 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; @@ -97,10 +96,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentTermList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentTermsListRequest nextRequest = PaymentTermsListRequest.builder() .from(request) .cursor(startingAfter) @@ -108,17 +108,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -174,16 +170,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..1f48b91b5 100644 --- a/src/main/java/com/merge/api/accounting/RawPaymentsClient.java +++ b/src/main/java/com/merge/api/accounting/RawPaymentsClient.java @@ -12,6 +12,7 @@ import com.merge.api.accounting.types.PaymentResponse; import com.merge.api.accounting.types.PaymentsLineItemsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsListRequest; +import com.merge.api.accounting.types.PaymentsMetaPatchRetrieveRequest; import com.merge.api.accounting.types.PaymentsRemoteFieldClassesListRequest; import com.merge.api.accounting.types.PaymentsRetrieveRequest; import com.merge.api.accounting.types.RemoteFieldClass; @@ -26,10 +27,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; import okhttp3.OkHttpClient; @@ -162,27 +160,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPaymentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsListRequest nextRequest = PaymentsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -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,10 +435,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsLineItemsRemoteFieldClassesListRequest nextRequest = PaymentsLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -465,19 +448,13 @@ public MergeApiHttpResponse> lineItemsRemot List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), - result, - parsedResponse, - () -> lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + !startingAfter.isEmpty(), result, parsedResponse, () -> lineItemsRemoteFieldClassesList( + 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); } @@ -487,40 +464,45 @@ public MergeApiHttpResponse> lineItemsRemot * Returns metadata for Payment PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, PaymentsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Payment PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, PaymentsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Payment PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, PaymentsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("accounting/v1/payments/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +535,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,10 +620,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PaymentsRemoteFieldClassesListRequest nextRequest = PaymentsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -652,17 +632,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/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..25fc84f56 100644 --- a/src/main/java/com/merge/api/accounting/RawProjectsClient.java +++ b/src/main/java/com/merge/api/accounting/RawProjectsClient.java @@ -92,17 +92,13 @@ 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()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedProjectList.class), - response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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 +154,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..6ca1f2cab 100644 --- a/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java +++ b/src/main/java/com/merge/api/accounting/RawPurchaseOrdersClient.java @@ -25,10 +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; import okhttp3.OkHttpClient; @@ -155,10 +152,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPurchaseOrderList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersListRequest nextRequest = PurchaseOrdersListRequest.builder() .from(request) .cursor(startingAfter) @@ -166,17 +164,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -205,12 +199,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 +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(), 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 +296,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,10 +381,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersLineItemsRemoteFieldClassesListRequest nextRequest = PurchaseOrdersLineItemsRemoteFieldClassesListRequest.builder() .from(request) @@ -408,19 +394,13 @@ public MergeApiHttpResponse> lineItemsRemot List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), - result, - parsedResponse, - () -> lineItemsRemoteFieldClassesList(nextRequest, requestOptions) + !startingAfter.isEmpty(), result, parsedResponse, () -> lineItemsRemoteFieldClassesList( + 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); } @@ -453,16 +433,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,10 +518,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PurchaseOrdersRemoteFieldClassesListRequest nextRequest = PurchaseOrdersRemoteFieldClassesListRequest.builder() .from(request) @@ -553,17 +531,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/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/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..d6174f3cb 100644 --- a/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/accounting/RawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -74,28 +73,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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/accounting/RawTaxRatesClient.java b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java index 95fb7da60..f7cfbba8e 100644 --- a/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java +++ b/src/main/java/com/merge/api/accounting/RawTaxRatesClient.java @@ -18,7 +18,6 @@ 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; @@ -125,27 +124,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaxRateList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TaxRatesListRequest nextRequest = TaxRatesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -201,16 +197,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..41b74dac0 100644 --- a/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java +++ b/src/main/java/com/merge/api/accounting/RawTrackingCategoriesClient.java @@ -18,7 +18,6 @@ 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; @@ -141,10 +140,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTrackingCategoryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TrackingCategoriesListRequest nextRequest = TrackingCategoriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -152,17 +152,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -226,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(), 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..90cd3fe89 100644 --- a/src/main/java/com/merge/api/accounting/RawTransactionsClient.java +++ b/src/main/java/com/merge/api/accounting/RawTransactionsClient.java @@ -18,7 +18,6 @@ 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; @@ -135,10 +134,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTransactionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TransactionsListRequest nextRequest = TransactionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -146,17 +146,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -212,16 +208,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..9feffad64 100644 --- a/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java +++ b/src/main/java/com/merge/api/accounting/RawVendorCreditsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -142,10 +139,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedVendorCreditList.class); + String startingAfter = parsedResponse.getNext().orElse(null); VendorCreditsListRequest nextRequest = VendorCreditsListRequest.builder() .from(request) .cursor(startingAfter) @@ -153,17 +151,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -192,12 +186,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 +206,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 +268,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(), VendorCredit.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, VendorCredit.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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 +307,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/types/Account.java b/src/main/java/com/merge/api/accounting/types/Account.java index 701308416..9b5043e99 100644 --- a/src/main/java/com/merge/api/accounting/types/Account.java +++ b/src/main/java/com/merge/api/accounting/types/Account.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -110,8 +113,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,16 +140,22 @@ public Optional getModifiedAt() { /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -157,16 +169,22 @@ public Optional getDescription() { *
  • REVENUE - REVENUE
  • * */ - @JsonProperty("classification") + @JsonIgnore public Optional getClassification() { + if (classification == null) { + return Optional.empty(); + } return classification; } /** * @return The account's type is a narrower and more specific grouping within the account's classification. */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -188,8 +206,11 @@ public Optional getType() { *
  • NON_POSTING - NON_POSTING
  • * */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } @@ -201,16 +222,22 @@ public Optional getAccountType() { *
  • INACTIVE - INACTIVE
  • * */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The account's current balance. */ - @JsonProperty("current_balance") + @JsonIgnore public Optional getCurrentBalance() { + if (currentBalance == null) { + return Optional.empty(); + } return currentBalance; } @@ -525,32 +552,44 @@ public Optional getCurrentBalance() { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The account's number. */ - @JsonProperty("account_number") + @JsonIgnore public Optional getAccountNumber() { + if (accountNumber == null) { + return Optional.empty(); + } return accountNumber; } /** * @return ID of the parent account. */ - @JsonProperty("parent_account") + @JsonIgnore public Optional getParentAccount() { + if (parentAccount == null) { + return Optional.empty(); + } return parentAccount; } /** * @return The company the account belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -562,13 +601,103 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("classification") + private Optional _getClassification() { + return classification; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("current_balance") + private Optional _getCurrentBalance() { + return currentBalance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_number") + private Optional _getAccountNumber() { + return accountNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_account") + private Optional _getParentAccount() { + return parentAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -726,6 +855,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -768,6 +908,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The account's description.

    */ @@ -782,6 +933,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The account's broadest grouping.

    *
      @@ -803,6 +965,17 @@ public Builder classification(AccountClassification classification) { return this; } + public Builder classification(Nullable classification) { + if (classification.isNull()) { + this.classification = null; + } else if (classification.isEmpty()) { + this.classification = Optional.empty(); + } else { + this.classification = Optional.of(classification.get()); + } + return this; + } + /** *

      The account's type is a narrower and more specific grouping within the account's classification.

      */ @@ -817,6 +990,17 @@ public Builder type(String type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

      Normalized account type- which is a narrower and more specific grouping within the account's classification.

      *
        @@ -846,6 +1030,17 @@ public Builder accountType(AccountAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + return this; + } + /** *

        The account's status.

        *
          @@ -865,6 +1060,17 @@ public Builder status(AccountStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The account's current balance.

          */ @@ -879,6 +1085,17 @@ public Builder currentBalance(Double currentBalance) { return this; } + public Builder currentBalance(Nullable currentBalance) { + if (currentBalance.isNull()) { + this.currentBalance = null; + } else if (currentBalance.isEmpty()) { + this.currentBalance = Optional.empty(); + } else { + this.currentBalance = Optional.of(currentBalance.get()); + } + return this; + } + /** *

          The account's currency.

          *
            @@ -1201,6 +1418,17 @@ public Builder currency(AccountCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

            The account's number.

            */ @@ -1215,6 +1443,17 @@ public Builder accountNumber(String accountNumber) { return this; } + public Builder accountNumber(Nullable accountNumber) { + if (accountNumber.isNull()) { + this.accountNumber = null; + } else if (accountNumber.isEmpty()) { + this.accountNumber = Optional.empty(); + } else { + this.accountNumber = Optional.of(accountNumber.get()); + } + return this; + } + /** *

            ID of the parent account.

            */ @@ -1229,6 +1468,17 @@ public Builder parentAccount(String parentAccount) { return this; } + public Builder parentAccount(Nullable parentAccount) { + if (parentAccount.isNull()) { + this.parentAccount = null; + } else if (parentAccount.isEmpty()) { + this.parentAccount = Optional.empty(); + } else { + this.parentAccount = Optional.of(parentAccount.get()); + } + return this; + } + /** *

            The company the account belongs to.

            */ @@ -1243,6 +1493,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

            */ @@ -1268,6 +1529,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1279,6 +1551,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Account build() { return new Account( id, 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..ef7a48f53 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountDetails.java +++ b/src/main/java/com/merge/api/accounting/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(CategoryEnum category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..dd8667b67 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/accounting/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/accounting/types/AccountIntegration.java b/src/main/java/com/merge/api/accounting/types/AccountIntegration.java index 5fc5630ad..e9b8a716e 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/accounting/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

            Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

            */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

            Company logo in square shape.

            */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

            The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

            */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

            Category or categories this integration is in beta status for.

            */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

            Company logo in square shape.

            * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

            Company logo in rectangular shape.

            * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. 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..c5fdd4ec5 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -83,16 +86,22 @@ private AccountRequest( /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -106,16 +115,22 @@ public Optional getDescription() { *
          • REVENUE - REVENUE
          • *
          */ - @JsonProperty("classification") + @JsonIgnore public Optional getClassification() { + if (classification == null) { + return Optional.empty(); + } return classification; } /** * @return The account's type is a narrower and more specific grouping within the account's classification. */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -137,8 +152,11 @@ public Optional getType() { *
        • NON_POSTING - NON_POSTING
        • *
        */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } @@ -150,16 +168,22 @@ public Optional getAccountType() { *
      • INACTIVE - INACTIVE
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The account's current balance. */ - @JsonProperty("current_balance") + @JsonIgnore public Optional getCurrentBalance() { + if (currentBalance == null) { + return Optional.empty(); + } return currentBalance; } @@ -474,42 +498,138 @@ public Optional getCurrentBalance() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The account's number. */ - @JsonProperty("account_number") + @JsonIgnore public Optional getAccountNumber() { + if (accountNumber == null) { + return Optional.empty(); + } return accountNumber; } /** * @return ID of the parent account. */ - @JsonProperty("parent_account") + @JsonIgnore public Optional getParentAccount() { + if (parentAccount == null) { + return Optional.empty(); + } return parentAccount; } /** * @return The company the account belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("classification") + private Optional _getClassification() { + return classification; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("current_balance") + private Optional _getCurrentBalance() { + return currentBalance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_number") + private Optional _getAccountNumber() { + return accountNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_account") + private Optional _getParentAccount() { + return parentAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -631,6 +751,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The account's description.

    */ @@ -645,6 +776,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The account's broadest grouping.

    *
      @@ -666,6 +808,17 @@ public Builder classification(AccountRequestClassification classification) { return this; } + public Builder classification(Nullable classification) { + if (classification.isNull()) { + this.classification = null; + } else if (classification.isEmpty()) { + this.classification = Optional.empty(); + } else { + this.classification = Optional.of(classification.get()); + } + return this; + } + /** *

      The account's type is a narrower and more specific grouping within the account's classification.

      */ @@ -680,6 +833,17 @@ public Builder type(String type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

      Normalized account type- which is a narrower and more specific grouping within the account's classification.

      *
        @@ -709,6 +873,17 @@ public Builder accountType(AccountRequestAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + return this; + } + /** *

        The account's status.

        *
          @@ -728,6 +903,17 @@ public Builder status(AccountRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The account's current balance.

          */ @@ -742,6 +928,17 @@ public Builder currentBalance(Double currentBalance) { return this; } + public Builder currentBalance(Nullable currentBalance) { + if (currentBalance.isNull()) { + this.currentBalance = null; + } else if (currentBalance.isEmpty()) { + this.currentBalance = Optional.empty(); + } else { + this.currentBalance = Optional.of(currentBalance.get()); + } + return this; + } + /** *

          The account's currency.

          *
            @@ -1064,6 +1261,17 @@ public Builder currency(AccountRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

            The account's number.

            */ @@ -1078,6 +1286,17 @@ public Builder accountNumber(String accountNumber) { return this; } + public Builder accountNumber(Nullable accountNumber) { + if (accountNumber.isNull()) { + this.accountNumber = null; + } else if (accountNumber.isEmpty()) { + this.accountNumber = Optional.empty(); + } else { + this.accountNumber = Optional.of(accountNumber.get()); + } + return this; + } + /** *

            ID of the parent account.

            */ @@ -1092,6 +1311,17 @@ public Builder parentAccount(String parentAccount) { return this; } + public Builder parentAccount(Nullable parentAccount) { + if (parentAccount.isNull()) { + this.parentAccount = null; + } else if (parentAccount.isEmpty()) { + this.parentAccount = Optional.empty(); + } else { + this.parentAccount = Optional.of(parentAccount.get()); + } + return this; + } + /** *

            The company the account belongs to.

            */ @@ -1106,6 +1336,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1117,6 +1358,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1128,6 +1380,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AccountRequest build() { return new AccountRequest( name, diff --git a/src/main/java/com/merge/api/accounting/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..bdb16b8b9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java index 42d25d61b..43014a1d5 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,24 +108,33 @@ public Optional getModifiedAt() { /** * @return The attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The attachment's url. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The company the accounting attachment belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -131,13 +146,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -255,6 +312,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -297,6 +365,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

            The attachment's url.

            */ @@ -311,6 +390,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

            The company the accounting attachment belongs to.

            */ @@ -325,6 +415,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

            */ @@ -350,6 +451,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -361,6 +473,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public AccountingAttachment build() { return new AccountingAttachment( id, diff --git a/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java index e29e73ef6..74767a9fa 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingAttachmentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -51,34 +54,79 @@ private AccountingAttachmentRequest( /** * @return The attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The attachment's url. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The company the accounting attachment belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -156,6 +204,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

            The attachment's url.

            */ @@ -170,6 +229,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

            The company the accounting attachment belongs to.

            */ @@ -184,6 +254,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -195,6 +276,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -206,6 +298,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AccountingAttachmentRequest build() { return new AccountingAttachmentRequest( fileName, fileUrl, company, integrationParams, linkedAccountParams, additionalProperties); 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..42d25eb25 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPeriod.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,39 +108,99 @@ public Optional getModifiedAt() { /** * @return Name of the accounting period. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return Beginning date of the period */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } /** * @return End date of the period */ - @JsonProperty("end_date") + @JsonIgnore public Optional getEndDate() { + if (endDate == null) { + return Optional.empty(); + } return endDate; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_date") + private Optional _getEndDate() { + return endDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -252,6 +318,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -294,6 +371,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "status", nulls = Nulls.SKIP) public Builder status(Optional status) { this.status = status; @@ -305,6 +393,17 @@ public Builder status(AccountingPeriodStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

            Beginning date of the period

            */ @@ -319,6 +418,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

            End date of the period

            */ @@ -333,6 +443,17 @@ public Builder endDate(OffsetDateTime endDate) { return this; } + public Builder endDate(Nullable endDate) { + if (endDate.isNull()) { + this.endDate = null; + } else if (endDate.isEmpty()) { + this.endDate = Optional.empty(); + } else { + this.endDate = Optional.of(endDate.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -344,6 +465,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -355,6 +487,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public AccountingPeriod build() { return new AccountingPeriod( id, diff --git a/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java index ff074e44c..fec75a894 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumber.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -63,16 +66,34 @@ public Optional getModifiedAt() { /** * @return The phone number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The phone number's type. */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { return type; } @@ -173,6 +194,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

            The phone number's type.

            */ @@ -187,6 +219,17 @@ public Builder type(String type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + public AccountingPhoneNumber build() { return new AccountingPhoneNumber(createdAt, modifiedAt, number, type, additionalProperties); } diff --git a/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java index 556ba145f..c26c8802d 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountingPhoneNumberRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,26 +50,62 @@ private AccountingPhoneNumberRequest( /** * @return The phone number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The phone number's type. */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -139,6 +178,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

            The phone number's type.

            */ @@ -153,6 +203,17 @@ public Builder type(String type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -164,6 +225,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -175,6 +247,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AccountingPhoneNumberRequest build() { return new AccountingPhoneNumberRequest( number, type, integrationParams, linkedAccountParams, additionalProperties); 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..d99f798ea 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountsListRequest.Builder.class) public final class AccountsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional accountType; @@ -62,7 +65,7 @@ public final class AccountsListRequest { private final Map additionalProperties; private AccountsListRequest( - Optional> expand, + Optional> expand, Optional accountType, Optional classification, Optional companyId, @@ -106,7 +109,7 @@ private AccountsListRequest( * @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; } @@ -121,8 +124,11 @@ public Optional getAccountType() { /** * @return If provided, will only return accounts with this classification. */ - @JsonProperty("classification") + @JsonIgnore public Optional getClassification() { + if (classification == null) { + return Optional.empty(); + } return classification; } @@ -201,8 +207,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return Accounts with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -225,8 +234,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -241,8 +253,35 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return accounts with this status. */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("classification") + private Optional _getClassification() { + return classification; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -312,7 +351,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 accountType = Optional.empty(); @@ -379,17 +418,17 @@ public Builder from(AccountsListRequest 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(AccountsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -422,6 +461,17 @@ public Builder classification(AccountsListRequestClassification classification) return this; } + public Builder classification(Nullable classification) { + if (classification.isNull()) { + this.classification = null; + } else if (classification.isEmpty()) { + this.classification = Optional.empty(); + } else { + this.classification = Optional.of(classification.get()); + } + return this; + } + /** *

            If provided, will only return accounts for this company.

            */ @@ -562,6 +612,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

            Number of results to return per page.

            */ @@ -604,6 +665,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

            */ @@ -632,6 +704,17 @@ public Builder status(AccountsListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public AccountsListRequest build() { return new AccountsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/AccountsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/AccountsListRequestExpandItem.java new file mode 100644 index 000000000..8c55db7ea --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AccountsListRequestExpandItem { + public static final AccountsListRequestExpandItem COMPANY = + new AccountsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + AccountsListRequestExpandItem(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 AccountsListRequestExpandItem + && this.string.equals(((AccountsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountsListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new AccountsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java index f8798c8a4..cbb5ff0a8 100644 --- a/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) public final class AccountsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -35,7 +35,7 @@ public final class AccountsRetrieveRequest { private final Map additionalProperties; private AccountsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Optional remoteFields, @@ -53,7 +53,7 @@ private AccountsRetrieveRequest( * @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(AccountsRetrieveRequest 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(AccountsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..db0b11ee0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AccountsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AccountsRetrieveRequestExpandItem { + public static final AccountsRetrieveRequestExpandItem COMPANY = + new AccountsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + AccountsRetrieveRequestExpandItem(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 AccountsRetrieveRequestExpandItem + && this.string.equals(((AccountsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new AccountsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} 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..face73429 100644 --- a/src/main/java/com/merge/api/accounting/types/Address.java +++ b/src/main/java/com/merge/api/accounting/types/Address.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -92,45 +95,66 @@ public Optional getModifiedAt() { *
          • SHIPPING - SHIPPING
          • *
          */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return Line 1 of the address's street. */ - @JsonProperty("street_1") + @JsonIgnore public Optional getStreet1() { + if (street1 == null) { + return Optional.empty(); + } return street1; } /** * @return Line 2 of the address's street. */ - @JsonProperty("street_2") + @JsonIgnore public Optional getStreet2() { + if (street2 == null) { + return Optional.empty(); + } return street2; } /** * @return The address's city. */ - @JsonProperty("city") + @JsonIgnore public Optional getCity() { + if (city == null) { + return Optional.empty(); + } return city; } - @JsonProperty("state") + /** + * @return The address's state or region. + */ + @JsonIgnore public Optional getState() { + if (state == null) { + return Optional.empty(); + } return state; } /** * @return The address's state or region. */ - @JsonProperty("country_subdivision") + @JsonIgnore public Optional getCountrySubdivision() { + if (countrySubdivision == null) { + return Optional.empty(); + } return countrySubdivision; } @@ -388,16 +412,70 @@ public Optional getCountrySubdivision() { *
        • ZW - Zimbabwe
        • *
        */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } /** * @return The address's zip code. */ - @JsonProperty("zip_code") + @JsonIgnore public Optional getZipCode() { + if (zipCode == null) { + return Optional.empty(); + } + return zipCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_1") + private Optional _getStreet1() { + return street1; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_2") + private Optional _getStreet2() { + return street2; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("city") + private Optional _getCity() { + return city; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("state") + private Optional _getState() { + return state; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country_subdivision") + private Optional _getCountrySubdivision() { + return countrySubdivision; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("zip_code") + private Optional _getZipCode() { return zipCode; } @@ -536,6 +614,17 @@ public Builder type(AddressType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

        Line 1 of the address's street.

        */ @@ -550,6 +639,17 @@ public Builder street1(String street1) { return this; } + public Builder street1(Nullable street1) { + if (street1.isNull()) { + this.street1 = null; + } else if (street1.isEmpty()) { + this.street1 = Optional.empty(); + } else { + this.street1 = Optional.of(street1.get()); + } + return this; + } + /** *

        Line 2 of the address's street.

        */ @@ -564,6 +664,17 @@ public Builder street2(String street2) { return this; } + public Builder street2(Nullable street2) { + if (street2.isNull()) { + this.street2 = null; + } else if (street2.isEmpty()) { + this.street2 = Optional.empty(); + } else { + this.street2 = Optional.of(street2.get()); + } + return this; + } + /** *

        The address's city.

        */ @@ -578,6 +689,20 @@ public Builder city(String city) { return this; } + public Builder city(Nullable city) { + if (city.isNull()) { + this.city = null; + } else if (city.isEmpty()) { + this.city = Optional.empty(); + } else { + this.city = Optional.of(city.get()); + } + return this; + } + + /** + *

        The address's state or region.

        + */ @JsonSetter(value = "state", nulls = Nulls.SKIP) public Builder state(Optional state) { this.state = state; @@ -589,6 +714,17 @@ public Builder state(JsonNode state) { return this; } + public Builder state(Nullable state) { + if (state.isNull()) { + this.state = null; + } else if (state.isEmpty()) { + this.state = Optional.empty(); + } else { + this.state = Optional.of(state.get()); + } + return this; + } + /** *

        The address's state or region.

        */ @@ -603,6 +739,17 @@ public Builder countrySubdivision(String countrySubdivision) { return this; } + public Builder countrySubdivision(Nullable countrySubdivision) { + if (countrySubdivision.isNull()) { + this.countrySubdivision = null; + } else if (countrySubdivision.isEmpty()) { + this.countrySubdivision = Optional.empty(); + } else { + this.countrySubdivision = Optional.of(countrySubdivision.get()); + } + return this; + } + /** *

        The address's country.

        *
          @@ -868,6 +1015,17 @@ public Builder country(AddressCountry country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

          The address's zip code.

          */ @@ -882,6 +1040,17 @@ public Builder zipCode(String zipCode) { return this; } + public Builder zipCode(Nullable zipCode) { + if (zipCode.isNull()) { + this.zipCode = null; + } else if (zipCode.isEmpty()) { + this.zipCode = Optional.empty(); + } else { + this.zipCode = Optional.of(zipCode.get()); + } + return this; + } + public Address build() { return new Address( createdAt, diff --git a/src/main/java/com/merge/api/accounting/types/AddressRequest.java b/src/main/java/com/merge/api/accounting/types/AddressRequest.java index 6a71f9a12..4c95c8b24 100644 --- a/src/main/java/com/merge/api/accounting/types/AddressRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AddressRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -71,40 +74,55 @@ private AddressRequest( *
        • SHIPPING - SHIPPING
        • *
        */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return Line 1 of the address's street. */ - @JsonProperty("street_1") + @JsonIgnore public Optional getStreet1() { + if (street1 == null) { + return Optional.empty(); + } return street1; } /** * @return Line 2 of the address's street. */ - @JsonProperty("street_2") + @JsonIgnore public Optional getStreet2() { + if (street2 == null) { + return Optional.empty(); + } return street2; } /** * @return The address's city. */ - @JsonProperty("city") + @JsonIgnore public Optional getCity() { + if (city == null) { + return Optional.empty(); + } return city; } /** * @return The address's state or region. */ - @JsonProperty("country_subdivision") + @JsonIgnore public Optional getCountrySubdivision() { + if (countrySubdivision == null) { + return Optional.empty(); + } return countrySubdivision; } @@ -362,26 +380,92 @@ public Optional getCountrySubdivision() { *
      • ZW - Zimbabwe
      • *
      */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } /** * @return The address's zip code. */ - @JsonProperty("zip_code") + @JsonIgnore public Optional getZipCode() { + if (zipCode == null) { + return Optional.empty(); + } return zipCode; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_1") + private Optional _getStreet1() { + return street1; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_2") + private Optional _getStreet2() { + return street2; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("city") + private Optional _getCity() { + return city; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country_subdivision") + private Optional _getCountrySubdivision() { + return countrySubdivision; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("zip_code") + private Optional _getZipCode() { + return zipCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -487,6 +571,17 @@ public Builder type(AddressRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

      Line 1 of the address's street.

      */ @@ -501,6 +596,17 @@ public Builder street1(String street1) { return this; } + public Builder street1(Nullable street1) { + if (street1.isNull()) { + this.street1 = null; + } else if (street1.isEmpty()) { + this.street1 = Optional.empty(); + } else { + this.street1 = Optional.of(street1.get()); + } + return this; + } + /** *

      Line 2 of the address's street.

      */ @@ -515,6 +621,17 @@ public Builder street2(String street2) { return this; } + public Builder street2(Nullable street2) { + if (street2.isNull()) { + this.street2 = null; + } else if (street2.isEmpty()) { + this.street2 = Optional.empty(); + } else { + this.street2 = Optional.of(street2.get()); + } + return this; + } + /** *

      The address's city.

      */ @@ -529,6 +646,17 @@ public Builder city(String city) { return this; } + public Builder city(Nullable city) { + if (city.isNull()) { + this.city = null; + } else if (city.isEmpty()) { + this.city = Optional.empty(); + } else { + this.city = Optional.of(city.get()); + } + return this; + } + /** *

      The address's state or region.

      */ @@ -543,6 +671,17 @@ public Builder countrySubdivision(String countrySubdivision) { return this; } + public Builder countrySubdivision(Nullable countrySubdivision) { + if (countrySubdivision.isNull()) { + this.countrySubdivision = null; + } else if (countrySubdivision.isEmpty()) { + this.countrySubdivision = Optional.empty(); + } else { + this.countrySubdivision = Optional.of(countrySubdivision.get()); + } + return this; + } + /** *

      The address's country.

      *
        @@ -808,6 +947,17 @@ public Builder country(AddressRequestCountry country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

        The address's zip code.

        */ @@ -822,6 +972,17 @@ public Builder zipCode(String zipCode) { return this; } + public Builder zipCode(Nullable zipCode) { + if (zipCode.isNull()) { + this.zipCode = null; + } else if (zipCode.isEmpty()) { + this.zipCode = Optional.empty(); + } else { + this.zipCode = Optional.of(zipCode.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -833,6 +994,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -844,6 +1016,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AddressRequest build() { return new AddressRequest( type, diff --git a/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java index 14ce945c4..2d2b2fbb3 100644 --- a/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequest.java @@ -24,17 +24,17 @@ public final class AddressesRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private AddressesRetrieveRequest( Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -63,7 +63,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -71,7 +71,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -113,9 +113,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,12 +162,12 @@ public Builder includeShellData(Boolean includeShellData) { *

        Deprecated. Use show_enum_origins.

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

        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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(AddressesRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..a29087e7a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 AddressesRetrieveRequestRemoteFields { + public static final AddressesRetrieveRequestRemoteFields TYPE = + new AddressesRetrieveRequestRemoteFields(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + AddressesRetrieveRequestRemoteFields(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 AddressesRetrieveRequestRemoteFields + && this.string.equals(((AddressesRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AddressesRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new AddressesRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..908798ebe --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AddressesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 AddressesRetrieveRequestShowEnumOrigins { + public static final AddressesRetrieveRequestShowEnumOrigins TYPE = + new AddressesRetrieveRequestShowEnumOrigins(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + AddressesRetrieveRequestShowEnumOrigins(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 AddressesRetrieveRequestShowEnumOrigins + && this.string.equals(((AddressesRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AddressesRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new AddressesRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..2ba1b2abc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/AsyncTasksRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/AsyncTasksRetrieveRequest.java new file mode 100644 index 000000000..3256797bc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/AsyncTasksRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncTasksRetrieveRequest.Builder.class) +public final class AsyncTasksRetrieveRequest { + private final Map additionalProperties; + + private AsyncTasksRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncTasksRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncTasksRetrieveRequest other) { + return this; + } + + public AsyncTasksRetrieveRequest build() { + return new AsyncTasksRetrieveRequest(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..0a1c80c7c 100644 --- a/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/AttachmentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -408,6 +420,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public AttachmentsListRequest build() { return new AttachmentsListRequest( companyId, 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..95185c473 100644 --- a/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/accounting/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

        The User's email at the time of this Event occurring.

        */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheet.java b/src/main/java/com/merge/api/accounting/types/BalanceSheet.java index 56351c782..dbd862dcb 100644 --- a/src/main/java/com/merge/api/accounting/types/BalanceSheet.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheet.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,8 +132,11 @@ public Optional getModifiedAt() { /** * @return The balance sheet's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -442,32 +451,44 @@ public Optional getName() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return Company object for the given BalanceSheet object. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The balance sheet's date. The balance sheet data will reflect the company's financial position this point in time. */ - @JsonProperty("date") + @JsonIgnore public Optional getDate() { + if (date == null) { + return Optional.empty(); + } return date; } /** * @return The balance sheet's net assets. */ - @JsonProperty("net_assets") + @JsonIgnore public Optional getNetAssets() { + if (netAssets == null) { + return Optional.empty(); + } return netAssets; } @@ -489,8 +510,11 @@ public Optional> getEquity() { /** * @return The time that balance sheet was generated by the accounting system. */ - @JsonProperty("remote_generated_at") + @JsonIgnore public Optional getRemoteGeneratedAt() { + if (remoteGeneratedAt == null) { + return Optional.empty(); + } return remoteGeneratedAt; } @@ -502,13 +526,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date") + private Optional _getDate() { + return date; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_assets") + private Optional _getNetAssets() { + return netAssets; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_generated_at") + private Optional _getRemoteGeneratedAt() { + return remoteGeneratedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -656,6 +740,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -698,6 +793,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      The balance sheet's currency.

      *
        @@ -1020,6 +1126,17 @@ public Builder currency(BalanceSheetCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        Company object for the given BalanceSheet object.

        */ @@ -1034,6 +1151,17 @@ public Builder company(BalanceSheetCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The balance sheet's date. The balance sheet data will reflect the company's financial position this point in time.

        */ @@ -1048,6 +1176,17 @@ public Builder date(OffsetDateTime date) { return this; } + public Builder date(Nullable date) { + if (date.isNull()) { + this.date = null; + } else if (date.isEmpty()) { + this.date = Optional.empty(); + } else { + this.date = Optional.of(date.get()); + } + return this; + } + /** *

        The balance sheet's net assets.

        */ @@ -1062,6 +1201,17 @@ public Builder netAssets(Double netAssets) { return this; } + public Builder netAssets(Nullable netAssets) { + if (netAssets.isNull()) { + this.netAssets = null; + } else if (netAssets.isEmpty()) { + this.netAssets = Optional.empty(); + } else { + this.netAssets = Optional.of(netAssets.get()); + } + return this; + } + @JsonSetter(value = "assets", nulls = Nulls.SKIP) public Builder assets(Optional> assets) { this.assets = assets; @@ -1109,6 +1259,17 @@ public Builder remoteGeneratedAt(OffsetDateTime remoteGeneratedAt) { return this; } + public Builder remoteGeneratedAt(Nullable remoteGeneratedAt) { + if (remoteGeneratedAt.isNull()) { + this.remoteGeneratedAt = null; + } else if (remoteGeneratedAt.isEmpty()) { + this.remoteGeneratedAt = Optional.empty(); + } else { + this.remoteGeneratedAt = Optional.of(remoteGeneratedAt.get()); + } + 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.

        */ @@ -1134,6 +1295,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1145,6 +1317,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public BalanceSheet build() { return new BalanceSheet( id, 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..703069b62 100644 --- a/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BalanceSheetsListRequest.Builder.class) public final class BalanceSheetsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional companyId; @@ -50,7 +53,7 @@ public final class BalanceSheetsListRequest { private final Map additionalProperties; private BalanceSheetsListRequest( - Optional> expand, + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, @@ -82,7 +85,7 @@ private BalanceSheetsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 companyId = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(BalanceSheetsListRequest 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(BalanceSheetsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public BalanceSheetsListRequest build() { return new BalanceSheetsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequestExpandItem.java new file mode 100644 index 000000000..64462c3ae --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 BalanceSheetsListRequestExpandItem { + public static final BalanceSheetsListRequestExpandItem COMPANY = + new BalanceSheetsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + BalanceSheetsListRequestExpandItem(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 BalanceSheetsListRequestExpandItem + && this.string.equals(((BalanceSheetsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BalanceSheetsListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new BalanceSheetsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java index 365ecf1a7..016a34fc2 100644 --- a/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BalanceSheetsRetrieveRequest.Builder.class) public final class BalanceSheetsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class BalanceSheetsRetrieveRequest { private final Map additionalProperties; private BalanceSheetsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private BalanceSheetsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(BalanceSheetsRetrieveRequest 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(BalanceSheetsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..56a079fbe --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BalanceSheetsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 BalanceSheetsRetrieveRequestExpandItem { + public static final BalanceSheetsRetrieveRequestExpandItem COMPANY = + new BalanceSheetsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + BalanceSheetsRetrieveRequestExpandItem(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 BalanceSheetsRetrieveRequestExpandItem + && this.string.equals(((BalanceSheetsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BalanceSheetsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new BalanceSheetsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} 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..bffadcfd5 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccount.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,40 +136,55 @@ public Optional getModifiedAt() { /** * @return The unique identifier of the source account from our customer’s platform. */ - @JsonProperty("source_account_id") + @JsonIgnore public Optional getSourceAccountId() { + if (sourceAccountId == null) { + return Optional.empty(); + } return sourceAccountId; } /** * @return The unique identifier of the target account from the third party software. */ - @JsonProperty("target_account_id") + @JsonIgnore public Optional getTargetAccountId() { + if (targetAccountId == null) { + return Optional.empty(); + } return targetAccountId; } /** * @return The name of the source account as stored in our customer’s platform. */ - @JsonProperty("source_account_name") + @JsonIgnore public Optional getSourceAccountName() { + if (sourceAccountName == null) { + return Optional.empty(); + } return sourceAccountName; } /** * @return The human-readable account number of the source account as stored in our customer’s platform. */ - @JsonProperty("source_account_number") + @JsonIgnore public Optional getSourceAccountNumber() { + if (sourceAccountNumber == null) { + return Optional.empty(); + } return sourceAccountNumber; } /** * @return The name of the target account from the third party software. */ - @JsonProperty("target_account_name") + @JsonIgnore public Optional getTargetAccountName() { + if (targetAccountName == null) { + return Optional.empty(); + } return targetAccountName; } @@ -478,8 +499,11 @@ public Optional getTargetAccountName() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } @@ -490,24 +514,33 @@ public Optional getCurrency() { *
    • INACTIVE - INACTIVE
    • *
    */ - @JsonProperty("feed_status") + @JsonIgnore public Optional getFeedStatus() { + if (feedStatus == null) { + return Optional.empty(); + } return feedStatus; } /** * @return The start date of the bank feed’s transactions. */ - @JsonProperty("feed_start_date") + @JsonIgnore public Optional getFeedStartDate() { + if (feedStartDate == null) { + return Optional.empty(); + } return feedStartDate; } /** * @return The current balance of funds in the source account. */ - @JsonProperty("source_account_balance") + @JsonIgnore public Optional getSourceAccountBalance() { + if (sourceAccountBalance == null) { + return Optional.empty(); + } return sourceAccountBalance; } @@ -518,8 +551,11 @@ public Optional getSourceAccountBalance() { *
  • CREDIT_CARD - CREDIT_CARD
  • * */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } @@ -531,13 +567,97 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional>>> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_id") + private Optional _getSourceAccountId() { + return sourceAccountId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_account_id") + private Optional _getTargetAccountId() { + return targetAccountId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_name") + private Optional _getSourceAccountName() { + return sourceAccountName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_number") + private Optional _getSourceAccountNumber() { + return sourceAccountNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_account_name") + private Optional _getTargetAccountName() { + return targetAccountName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("feed_status") + private Optional _getFeedStatus() { + return feedStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("feed_start_date") + private Optional _getFeedStartDate() { + return feedStartDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_balance") + private Optional _getSourceAccountBalance() { + return sourceAccountBalance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional>>> _getRemoteData() { return remoteData; } @@ -690,6 +810,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -732,6 +863,17 @@ public Builder sourceAccountId(String sourceAccountId) { return this; } + public Builder sourceAccountId(Nullable sourceAccountId) { + if (sourceAccountId.isNull()) { + this.sourceAccountId = null; + } else if (sourceAccountId.isEmpty()) { + this.sourceAccountId = Optional.empty(); + } else { + this.sourceAccountId = Optional.of(sourceAccountId.get()); + } + return this; + } + /** *

    The unique identifier of the target account from the third party software.

    */ @@ -746,6 +888,17 @@ public Builder targetAccountId(String targetAccountId) { return this; } + public Builder targetAccountId(Nullable targetAccountId) { + if (targetAccountId.isNull()) { + this.targetAccountId = null; + } else if (targetAccountId.isEmpty()) { + this.targetAccountId = Optional.empty(); + } else { + this.targetAccountId = Optional.of(targetAccountId.get()); + } + return this; + } + /** *

    The name of the source account as stored in our customer’s platform.

    */ @@ -760,6 +913,17 @@ public Builder sourceAccountName(String sourceAccountName) { return this; } + public Builder sourceAccountName(Nullable sourceAccountName) { + if (sourceAccountName.isNull()) { + this.sourceAccountName = null; + } else if (sourceAccountName.isEmpty()) { + this.sourceAccountName = Optional.empty(); + } else { + this.sourceAccountName = Optional.of(sourceAccountName.get()); + } + return this; + } + /** *

    The human-readable account number of the source account as stored in our customer’s platform.

    */ @@ -774,6 +938,17 @@ public Builder sourceAccountNumber(String sourceAccountNumber) { return this; } + public Builder sourceAccountNumber(Nullable sourceAccountNumber) { + if (sourceAccountNumber.isNull()) { + this.sourceAccountNumber = null; + } else if (sourceAccountNumber.isEmpty()) { + this.sourceAccountNumber = Optional.empty(); + } else { + this.sourceAccountNumber = Optional.of(sourceAccountNumber.get()); + } + return this; + } + /** *

    The name of the target account from the third party software.

    */ @@ -788,6 +963,17 @@ public Builder targetAccountName(String targetAccountName) { return this; } + public Builder targetAccountName(Nullable targetAccountName) { + if (targetAccountName.isNull()) { + this.targetAccountName = null; + } else if (targetAccountName.isEmpty()) { + this.targetAccountName = Optional.empty(); + } else { + this.targetAccountName = Optional.of(targetAccountName.get()); + } + return this; + } + /** *

    The currency code of the bank feed.

    *
      @@ -1110,6 +1296,17 @@ public Builder currency(BankFeedAccountCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The status of the bank feed.

      *
        @@ -1128,6 +1325,17 @@ public Builder feedStatus(BankFeedAccountFeedStatus feedStatus) { return this; } + public Builder feedStatus(Nullable feedStatus) { + if (feedStatus.isNull()) { + this.feedStatus = null; + } else if (feedStatus.isEmpty()) { + this.feedStatus = Optional.empty(); + } else { + this.feedStatus = Optional.of(feedStatus.get()); + } + return this; + } + /** *

        The start date of the bank feed’s transactions.

        */ @@ -1142,6 +1350,17 @@ public Builder feedStartDate(OffsetDateTime feedStartDate) { return this; } + public Builder feedStartDate(Nullable feedStartDate) { + if (feedStartDate.isNull()) { + this.feedStartDate = null; + } else if (feedStartDate.isEmpty()) { + this.feedStartDate = Optional.empty(); + } else { + this.feedStartDate = Optional.of(feedStartDate.get()); + } + return this; + } + /** *

        The current balance of funds in the source account.

        */ @@ -1156,6 +1375,17 @@ public Builder sourceAccountBalance(Double sourceAccountBalance) { return this; } + public Builder sourceAccountBalance(Nullable sourceAccountBalance) { + if (sourceAccountBalance.isNull()) { + this.sourceAccountBalance = null; + } else if (sourceAccountBalance.isEmpty()) { + this.sourceAccountBalance = Optional.empty(); + } else { + this.sourceAccountBalance = Optional.of(sourceAccountBalance.get()); + } + return this; + } + /** *

        The type of the account.

        *
          @@ -1174,6 +1404,17 @@ public Builder accountType(BankFeedAccountAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + 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.

          */ @@ -1199,6 +1440,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional>>> remoteData) { this.remoteData = remoteData; @@ -1210,6 +1462,17 @@ public Builder remoteData(List>> remoteData) { return this; } + public Builder remoteData(Nullable>>> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public BankFeedAccount build() { return new BankFeedAccount( id, 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..974c6dd1a 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedAccountRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -80,40 +83,55 @@ private BankFeedAccountRequest( /** * @return The unique identifier of the source account from our customer’s platform. */ - @JsonProperty("source_account_id") + @JsonIgnore public Optional getSourceAccountId() { + if (sourceAccountId == null) { + return Optional.empty(); + } return sourceAccountId; } /** * @return The unique identifier of the target account from the third party software. */ - @JsonProperty("target_account_id") + @JsonIgnore public Optional getTargetAccountId() { + if (targetAccountId == null) { + return Optional.empty(); + } return targetAccountId; } /** * @return The name of the source account as stored in our customer’s platform. */ - @JsonProperty("source_account_name") + @JsonIgnore public Optional getSourceAccountName() { + if (sourceAccountName == null) { + return Optional.empty(); + } return sourceAccountName; } /** * @return The human-readable account number of the source account as stored in our customer’s platform. */ - @JsonProperty("source_account_number") + @JsonIgnore public Optional getSourceAccountNumber() { + if (sourceAccountNumber == null) { + return Optional.empty(); + } return sourceAccountNumber; } /** * @return The name of the target account from the third party software. */ - @JsonProperty("target_account_name") + @JsonIgnore public Optional getTargetAccountName() { + if (targetAccountName == null) { + return Optional.empty(); + } return targetAccountName; } @@ -428,8 +446,11 @@ public Optional getTargetAccountName() { *
        • ZWL - Zimbabwean Dollar (2009)
        • *
        */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } @@ -440,24 +461,33 @@ public Optional getCurrency() { *
      • INACTIVE - INACTIVE
      • *
      */ - @JsonProperty("feed_status") + @JsonIgnore public Optional getFeedStatus() { + if (feedStatus == null) { + return Optional.empty(); + } return feedStatus; } /** * @return The start date of the bank feed’s transactions. */ - @JsonProperty("feed_start_date") + @JsonIgnore public Optional getFeedStartDate() { + if (feedStartDate == null) { + return Optional.empty(); + } return feedStartDate; } /** * @return The current balance of funds in the source account. */ - @JsonProperty("source_account_balance") + @JsonIgnore public Optional getSourceAccountBalance() { + if (sourceAccountBalance == null) { + return Optional.empty(); + } return sourceAccountBalance; } @@ -468,18 +498,99 @@ public Optional getSourceAccountBalance() { *
    • CREDIT_CARD - CREDIT_CARD
    • *
    */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_id") + private Optional _getSourceAccountId() { + return sourceAccountId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_account_id") + private Optional _getTargetAccountId() { + return targetAccountId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_name") + private Optional _getSourceAccountName() { + return sourceAccountName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_number") + private Optional _getSourceAccountNumber() { + return sourceAccountNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_account_name") + private Optional _getTargetAccountName() { + return targetAccountName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("feed_status") + private Optional _getFeedStatus() { + return feedStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("feed_start_date") + private Optional _getFeedStartDate() { + return feedStartDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_account_balance") + private Optional _getSourceAccountBalance() { + return sourceAccountBalance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -596,6 +707,17 @@ public Builder sourceAccountId(String sourceAccountId) { return this; } + public Builder sourceAccountId(Nullable sourceAccountId) { + if (sourceAccountId.isNull()) { + this.sourceAccountId = null; + } else if (sourceAccountId.isEmpty()) { + this.sourceAccountId = Optional.empty(); + } else { + this.sourceAccountId = Optional.of(sourceAccountId.get()); + } + return this; + } + /** *

    The unique identifier of the target account from the third party software.

    */ @@ -610,6 +732,17 @@ public Builder targetAccountId(String targetAccountId) { return this; } + public Builder targetAccountId(Nullable targetAccountId) { + if (targetAccountId.isNull()) { + this.targetAccountId = null; + } else if (targetAccountId.isEmpty()) { + this.targetAccountId = Optional.empty(); + } else { + this.targetAccountId = Optional.of(targetAccountId.get()); + } + return this; + } + /** *

    The name of the source account as stored in our customer’s platform.

    */ @@ -624,6 +757,17 @@ public Builder sourceAccountName(String sourceAccountName) { return this; } + public Builder sourceAccountName(Nullable sourceAccountName) { + if (sourceAccountName.isNull()) { + this.sourceAccountName = null; + } else if (sourceAccountName.isEmpty()) { + this.sourceAccountName = Optional.empty(); + } else { + this.sourceAccountName = Optional.of(sourceAccountName.get()); + } + return this; + } + /** *

    The human-readable account number of the source account as stored in our customer’s platform.

    */ @@ -638,6 +782,17 @@ public Builder sourceAccountNumber(String sourceAccountNumber) { return this; } + public Builder sourceAccountNumber(Nullable sourceAccountNumber) { + if (sourceAccountNumber.isNull()) { + this.sourceAccountNumber = null; + } else if (sourceAccountNumber.isEmpty()) { + this.sourceAccountNumber = Optional.empty(); + } else { + this.sourceAccountNumber = Optional.of(sourceAccountNumber.get()); + } + return this; + } + /** *

    The name of the target account from the third party software.

    */ @@ -652,6 +807,17 @@ public Builder targetAccountName(String targetAccountName) { return this; } + public Builder targetAccountName(Nullable targetAccountName) { + if (targetAccountName.isNull()) { + this.targetAccountName = null; + } else if (targetAccountName.isEmpty()) { + this.targetAccountName = Optional.empty(); + } else { + this.targetAccountName = Optional.of(targetAccountName.get()); + } + return this; + } + /** *

    The currency code of the bank feed.

    *
      @@ -974,6 +1140,17 @@ public Builder currency(BankFeedAccountRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The status of the bank feed.

      *
        @@ -992,6 +1169,17 @@ public Builder feedStatus(BankFeedAccountRequestFeedStatus feedStatus) { return this; } + public Builder feedStatus(Nullable feedStatus) { + if (feedStatus.isNull()) { + this.feedStatus = null; + } else if (feedStatus.isEmpty()) { + this.feedStatus = Optional.empty(); + } else { + this.feedStatus = Optional.of(feedStatus.get()); + } + return this; + } + /** *

        The start date of the bank feed’s transactions.

        */ @@ -1006,6 +1194,17 @@ public Builder feedStartDate(OffsetDateTime feedStartDate) { return this; } + public Builder feedStartDate(Nullable feedStartDate) { + if (feedStartDate.isNull()) { + this.feedStartDate = null; + } else if (feedStartDate.isEmpty()) { + this.feedStartDate = Optional.empty(); + } else { + this.feedStartDate = Optional.of(feedStartDate.get()); + } + return this; + } + /** *

        The current balance of funds in the source account.

        */ @@ -1020,6 +1219,17 @@ public Builder sourceAccountBalance(Double sourceAccountBalance) { return this; } + public Builder sourceAccountBalance(Nullable sourceAccountBalance) { + if (sourceAccountBalance.isNull()) { + this.sourceAccountBalance = null; + } else if (sourceAccountBalance.isEmpty()) { + this.sourceAccountBalance = Optional.empty(); + } else { + this.sourceAccountBalance = Optional.of(sourceAccountBalance.get()); + } + return this; + } + /** *

        The type of the account.

        *
          @@ -1038,6 +1248,17 @@ public Builder accountType(BankFeedAccountRequestAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1049,6 +1270,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1060,6 +1292,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public BankFeedAccountRequest build() { return new BankFeedAccountRequest( sourceAccountId, 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..5c04b4c45 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransaction.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -96,8 +99,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -120,56 +126,77 @@ public Optional getModifiedAt() { /** * @return The bank feed account associated with the transaction. */ - @JsonProperty("bank_feed_account") + @JsonIgnore public Optional getBankFeedAccount() { + if (bankFeedAccount == null) { + return Optional.empty(); + } return bankFeedAccount; } /** * @return The date that the transaction occurred. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The date the transaction was posted to the bank account. */ - @JsonProperty("posted_date") + @JsonIgnore public Optional getPostedDate() { + if (postedDate == null) { + return Optional.empty(); + } return postedDate; } /** * @return The amount of the transaction. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return The description of the transaction. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The underlying type of the transaction. */ - @JsonProperty("transaction_type") + @JsonIgnore public Optional getTransactionType() { + if (transactionType == null) { + return Optional.empty(); + } return transactionType; } /** * @return The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid. */ - @JsonProperty("payee") + @JsonIgnore public Optional getPayee() { + if (payee == null) { + return Optional.empty(); + } return payee; } @@ -180,16 +207,22 @@ public Optional getPayee() { *
        • DEBIT - DEBIT
        • *
        */ - @JsonProperty("credit_or_debit") + @JsonIgnore public Optional getCreditOrDebit() { + if (creditOrDebit == null) { + return Optional.empty(); + } return creditOrDebit; } /** * @return The customer’s identifier for the transaction. */ - @JsonProperty("source_transaction_id") + @JsonIgnore public Optional getSourceTransactionId() { + if (sourceTransactionId == null) { + return Optional.empty(); + } return sourceTransactionId; } @@ -209,6 +242,66 @@ public Optional getIsProcessed() { return isProcessed; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bank_feed_account") + private Optional _getBankFeedAccount() { + return bankFeedAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posted_date") + private Optional _getPostedDate() { + return postedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_type") + private Optional _getTransactionType() { + return transactionType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payee") + private Optional _getPayee() { + return payee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credit_or_debit") + private Optional _getCreditOrDebit() { + return creditOrDebit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_transaction_id") + private Optional _getSourceTransactionId() { + return sourceTransactionId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -348,6 +441,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -390,6 +494,17 @@ public Builder bankFeedAccount(BankFeedTransactionBankFeedAccount bankFeedAccoun return this; } + public Builder bankFeedAccount(Nullable bankFeedAccount) { + if (bankFeedAccount.isNull()) { + this.bankFeedAccount = null; + } else if (bankFeedAccount.isEmpty()) { + this.bankFeedAccount = Optional.empty(); + } else { + this.bankFeedAccount = Optional.of(bankFeedAccount.get()); + } + return this; + } + /** *

        The date that the transaction occurred.

        */ @@ -404,6 +519,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

        The date the transaction was posted to the bank account.

        */ @@ -418,6 +544,17 @@ public Builder postedDate(OffsetDateTime postedDate) { return this; } + public Builder postedDate(Nullable postedDate) { + if (postedDate.isNull()) { + this.postedDate = null; + } else if (postedDate.isEmpty()) { + this.postedDate = Optional.empty(); + } else { + this.postedDate = Optional.of(postedDate.get()); + } + return this; + } + /** *

        The amount of the transaction.

        */ @@ -432,6 +569,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

        The description of the transaction.

        */ @@ -446,6 +594,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The underlying type of the transaction.

        */ @@ -460,6 +619,17 @@ public Builder transactionType(String transactionType) { return this; } + public Builder transactionType(Nullable transactionType) { + if (transactionType.isNull()) { + this.transactionType = null; + } else if (transactionType.isEmpty()) { + this.transactionType = Optional.empty(); + } else { + this.transactionType = Optional.of(transactionType.get()); + } + return this; + } + /** *

        The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.

        */ @@ -474,6 +644,17 @@ public Builder payee(String payee) { return this; } + public Builder payee(Nullable payee) { + if (payee.isNull()) { + this.payee = null; + } else if (payee.isEmpty()) { + this.payee = Optional.empty(); + } else { + this.payee = Optional.of(payee.get()); + } + return this; + } + /** *

        If the transaction is of type debit or credit.

        *
          @@ -492,6 +673,17 @@ public Builder creditOrDebit(BankFeedTransactionCreditOrDebit creditOrDebit) { return this; } + public Builder creditOrDebit(Nullable creditOrDebit) { + if (creditOrDebit.isNull()) { + this.creditOrDebit = null; + } else if (creditOrDebit.isEmpty()) { + this.creditOrDebit = Optional.empty(); + } else { + this.creditOrDebit = Optional.of(creditOrDebit.get()); + } + return this; + } + /** *

          The customer’s identifier for the transaction.

          */ @@ -506,6 +698,17 @@ public Builder sourceTransactionId(String sourceTransactionId) { return this; } + public Builder sourceTransactionId(Nullable sourceTransactionId) { + if (sourceTransactionId.isNull()) { + this.sourceTransactionId = null; + } else if (sourceTransactionId.isEmpty()) { + this.sourceTransactionId = Optional.empty(); + } else { + this.sourceTransactionId = Optional.of(sourceTransactionId.get()); + } + 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.

          */ diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequest.java index bea10f39c..036675f74 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionRequestRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -76,56 +79,77 @@ private BankFeedTransactionRequestRequest( /** * @return The bank feed account associated with the transaction. */ - @JsonProperty("bank_feed_account") + @JsonIgnore public Optional getBankFeedAccount() { + if (bankFeedAccount == null) { + return Optional.empty(); + } return bankFeedAccount; } /** * @return The date that the transaction occurred. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The date the transaction was posted to the bank account. */ - @JsonProperty("posted_date") + @JsonIgnore public Optional getPostedDate() { + if (postedDate == null) { + return Optional.empty(); + } return postedDate; } /** * @return The amount of the transaction. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return The description of the transaction. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The underlying type of the transaction. */ - @JsonProperty("transaction_type") + @JsonIgnore public Optional getTransactionType() { + if (transactionType == null) { + return Optional.empty(); + } return transactionType; } /** * @return The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid. */ - @JsonProperty("payee") + @JsonIgnore public Optional getPayee() { + if (payee == null) { + return Optional.empty(); + } return payee; } @@ -136,26 +160,104 @@ public Optional getPayee() { *
        • DEBIT - DEBIT
        • *
        */ - @JsonProperty("credit_or_debit") + @JsonIgnore public Optional getCreditOrDebit() { + if (creditOrDebit == null) { + return Optional.empty(); + } return creditOrDebit; } /** * @return The customer’s identifier for the transaction. */ - @JsonProperty("source_transaction_id") + @JsonIgnore public Optional getSourceTransactionId() { + if (sourceTransactionId == null) { + return Optional.empty(); + } return sourceTransactionId; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bank_feed_account") + private Optional _getBankFeedAccount() { + return bankFeedAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posted_date") + private Optional _getPostedDate() { + return postedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_type") + private Optional _getTransactionType() { + return transactionType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payee") + private Optional _getPayee() { + return payee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credit_or_debit") + private Optional _getCreditOrDebit() { + return creditOrDebit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source_transaction_id") + private Optional _getSourceTransactionId() { + return sourceTransactionId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -267,6 +369,17 @@ public Builder bankFeedAccount(BankFeedTransactionRequestRequestBankFeedAccount return this; } + public Builder bankFeedAccount(Nullable bankFeedAccount) { + if (bankFeedAccount.isNull()) { + this.bankFeedAccount = null; + } else if (bankFeedAccount.isEmpty()) { + this.bankFeedAccount = Optional.empty(); + } else { + this.bankFeedAccount = Optional.of(bankFeedAccount.get()); + } + return this; + } + /** *

        The date that the transaction occurred.

        */ @@ -281,6 +394,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

        The date the transaction was posted to the bank account.

        */ @@ -295,6 +419,17 @@ public Builder postedDate(OffsetDateTime postedDate) { return this; } + public Builder postedDate(Nullable postedDate) { + if (postedDate.isNull()) { + this.postedDate = null; + } else if (postedDate.isEmpty()) { + this.postedDate = Optional.empty(); + } else { + this.postedDate = Optional.of(postedDate.get()); + } + return this; + } + /** *

        The amount of the transaction.

        */ @@ -309,6 +444,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

        The description of the transaction.

        */ @@ -323,6 +469,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The underlying type of the transaction.

        */ @@ -337,6 +494,17 @@ public Builder transactionType(String transactionType) { return this; } + public Builder transactionType(Nullable transactionType) { + if (transactionType.isNull()) { + this.transactionType = null; + } else if (transactionType.isEmpty()) { + this.transactionType = Optional.empty(); + } else { + this.transactionType = Optional.of(transactionType.get()); + } + return this; + } + /** *

        The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.

        */ @@ -351,6 +519,17 @@ public Builder payee(String payee) { return this; } + public Builder payee(Nullable payee) { + if (payee.isNull()) { + this.payee = null; + } else if (payee.isEmpty()) { + this.payee = Optional.empty(); + } else { + this.payee = Optional.of(payee.get()); + } + return this; + } + /** *

        If the transaction is of type debit or credit.

        *
          @@ -369,6 +548,17 @@ public Builder creditOrDebit(BankFeedTransactionRequestRequestCreditOrDebit cred return this; } + public Builder creditOrDebit(Nullable creditOrDebit) { + if (creditOrDebit.isNull()) { + this.creditOrDebit = null; + } else if (creditOrDebit.isEmpty()) { + this.creditOrDebit = Optional.empty(); + } else { + this.creditOrDebit = Optional.of(creditOrDebit.get()); + } + return this; + } + /** *

          The customer’s identifier for the transaction.

          */ @@ -383,6 +573,17 @@ public Builder sourceTransactionId(String sourceTransactionId) { return this; } + public Builder sourceTransactionId(Nullable sourceTransactionId) { + if (sourceTransactionId.isNull()) { + this.sourceTransactionId = null; + } else if (sourceTransactionId.isEmpty()) { + this.sourceTransactionId = Optional.empty(); + } else { + this.sourceTransactionId = Optional.of(sourceTransactionId.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -394,6 +595,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -405,6 +617,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public BankFeedTransactionRequestRequest build() { return new BankFeedTransactionRequestRequest( bankFeedAccount, 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..7051d613d 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankFeedTransactionsListRequest.Builder.class) public final class BankFeedTransactionsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class BankFeedTransactionsListRequest { private final Map additionalProperties; private BankFeedTransactionsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private BankFeedTransactionsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 createdAfter = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(BankFeedTransactionsListRequest 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(BankFeedTransactionsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public BankFeedTransactionsListRequest build() { return new BankFeedTransactionsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequestExpandItem.java new file mode 100644 index 000000000..b5a25597c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 BankFeedTransactionsListRequestExpandItem { + public static final BankFeedTransactionsListRequestExpandItem BANK_FEED_ACCOUNT = + new BankFeedTransactionsListRequestExpandItem(Value.BANK_FEED_ACCOUNT, "bank_feed_account"); + + private final Value value; + + private final String string; + + BankFeedTransactionsListRequestExpandItem(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 BankFeedTransactionsListRequestExpandItem + && this.string.equals(((BankFeedTransactionsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BANK_FEED_ACCOUNT: + return visitor.visitBankFeedAccount(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankFeedTransactionsListRequestExpandItem valueOf(String value) { + switch (value) { + case "bank_feed_account": + return BANK_FEED_ACCOUNT; + default: + return new BankFeedTransactionsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + BANK_FEED_ACCOUNT, + + UNKNOWN + } + + public interface Visitor { + T visitBankFeedAccount(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java index 601412edd..4da229bf4 100644 --- a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankFeedTransactionsRetrieveRequest.Builder.class) public final class BankFeedTransactionsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class BankFeedTransactionsRetrieveRequest { private final Map additionalProperties; private BankFeedTransactionsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private BankFeedTransactionsRetrieveRequest( * @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; } @@ -99,7 +99,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(); @@ -121,17 +121,17 @@ public Builder from(BankFeedTransactionsRetrieveRequest 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(BankFeedTransactionsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..69b43ab90 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/BankFeedTransactionsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 BankFeedTransactionsRetrieveRequestExpandItem { + public static final BankFeedTransactionsRetrieveRequestExpandItem BANK_FEED_ACCOUNT = + new BankFeedTransactionsRetrieveRequestExpandItem(Value.BANK_FEED_ACCOUNT, "bank_feed_account"); + + private final Value value; + + private final String string; + + BankFeedTransactionsRetrieveRequestExpandItem(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 BankFeedTransactionsRetrieveRequestExpandItem + && this.string.equals(((BankFeedTransactionsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BANK_FEED_ACCOUNT: + return visitor.visitBankFeedAccount(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankFeedTransactionsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "bank_feed_account": + return BANK_FEED_ACCOUNT; + default: + return new BankFeedTransactionsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + BANK_FEED_ACCOUNT, + + UNKNOWN + } + + public interface Visitor { + T visitBankFeedAccount(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java index cfd45d633..7609670d8 100644 --- a/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatement.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -110,8 +113,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,8 +140,11 @@ public Optional getModifiedAt() { /** * @return The cash flow statement's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -450,48 +459,66 @@ public Optional getName() { *
        • ZWL - Zimbabwean Dollar (2009)
        • *
        */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The company the cash flow statement belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The cash flow statement's start period. */ - @JsonProperty("start_period") + @JsonIgnore public Optional getStartPeriod() { + if (startPeriod == null) { + return Optional.empty(); + } return startPeriod; } /** * @return The cash flow statement's end period. */ - @JsonProperty("end_period") + @JsonIgnore public Optional getEndPeriod() { + if (endPeriod == null) { + return Optional.empty(); + } return endPeriod; } /** * @return Cash and cash equivalents at the beginning of the cash flow statement's period. */ - @JsonProperty("cash_at_beginning_of_period") + @JsonIgnore public Optional getCashAtBeginningOfPeriod() { + if (cashAtBeginningOfPeriod == null) { + return Optional.empty(); + } return cashAtBeginningOfPeriod; } /** * @return Cash and cash equivalents at the beginning of the cash flow statement's period. */ - @JsonProperty("cash_at_end_of_period") + @JsonIgnore public Optional getCashAtEndOfPeriod() { + if (cashAtEndOfPeriod == null) { + return Optional.empty(); + } return cashAtEndOfPeriod; } @@ -513,8 +540,11 @@ public Optional> getFinancingActivities() { /** * @return The time that cash flow statement was generated by the accounting system. */ - @JsonProperty("remote_generated_at") + @JsonIgnore public Optional getRemoteGeneratedAt() { + if (remoteGeneratedAt == null) { + return Optional.empty(); + } return remoteGeneratedAt; } @@ -526,13 +556,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_period") + private Optional _getStartPeriod() { + return startPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_period") + private Optional _getEndPeriod() { + return endPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cash_at_beginning_of_period") + private Optional _getCashAtBeginningOfPeriod() { + return cashAtBeginningOfPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cash_at_end_of_period") + private Optional _getCashAtEndOfPeriod() { + return cashAtEndOfPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_generated_at") + private Optional _getRemoteGeneratedAt() { + return remoteGeneratedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -690,6 +792,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -732,6 +845,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The cash flow statement's currency.

        *
          @@ -1054,6 +1178,17 @@ public Builder currency(CashFlowStatementCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

          The company the cash flow statement belongs to.

          */ @@ -1068,6 +1203,17 @@ public Builder company(CashFlowStatementCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The cash flow statement's start period.

          */ @@ -1082,6 +1228,17 @@ public Builder startPeriod(OffsetDateTime startPeriod) { return this; } + public Builder startPeriod(Nullable startPeriod) { + if (startPeriod.isNull()) { + this.startPeriod = null; + } else if (startPeriod.isEmpty()) { + this.startPeriod = Optional.empty(); + } else { + this.startPeriod = Optional.of(startPeriod.get()); + } + return this; + } + /** *

          The cash flow statement's end period.

          */ @@ -1096,6 +1253,17 @@ public Builder endPeriod(OffsetDateTime endPeriod) { return this; } + public Builder endPeriod(Nullable endPeriod) { + if (endPeriod.isNull()) { + this.endPeriod = null; + } else if (endPeriod.isEmpty()) { + this.endPeriod = Optional.empty(); + } else { + this.endPeriod = Optional.of(endPeriod.get()); + } + return this; + } + /** *

          Cash and cash equivalents at the beginning of the cash flow statement's period.

          */ @@ -1110,6 +1278,17 @@ public Builder cashAtBeginningOfPeriod(Double cashAtBeginningOfPeriod) { return this; } + public Builder cashAtBeginningOfPeriod(Nullable cashAtBeginningOfPeriod) { + if (cashAtBeginningOfPeriod.isNull()) { + this.cashAtBeginningOfPeriod = null; + } else if (cashAtBeginningOfPeriod.isEmpty()) { + this.cashAtBeginningOfPeriod = Optional.empty(); + } else { + this.cashAtBeginningOfPeriod = Optional.of(cashAtBeginningOfPeriod.get()); + } + return this; + } + /** *

          Cash and cash equivalents at the beginning of the cash flow statement's period.

          */ @@ -1124,6 +1303,17 @@ public Builder cashAtEndOfPeriod(Double cashAtEndOfPeriod) { return this; } + public Builder cashAtEndOfPeriod(Nullable cashAtEndOfPeriod) { + if (cashAtEndOfPeriod.isNull()) { + this.cashAtEndOfPeriod = null; + } else if (cashAtEndOfPeriod.isEmpty()) { + this.cashAtEndOfPeriod = Optional.empty(); + } else { + this.cashAtEndOfPeriod = Optional.of(cashAtEndOfPeriod.get()); + } + return this; + } + @JsonSetter(value = "operating_activities", nulls = Nulls.SKIP) public Builder operatingActivities(Optional> operatingActivities) { this.operatingActivities = operatingActivities; @@ -1171,6 +1361,17 @@ public Builder remoteGeneratedAt(OffsetDateTime remoteGeneratedAt) { return this; } + public Builder remoteGeneratedAt(Nullable remoteGeneratedAt) { + if (remoteGeneratedAt.isNull()) { + this.remoteGeneratedAt = null; + } else if (remoteGeneratedAt.isEmpty()) { + this.remoteGeneratedAt = Optional.empty(); + } else { + this.remoteGeneratedAt = Optional.of(remoteGeneratedAt.get()); + } + 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.

          */ @@ -1196,6 +1397,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1207,6 +1419,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public CashFlowStatement build() { return new CashFlowStatement( id, 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..b11b5367d 100644 --- a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CashFlowStatementsListRequest.Builder.class) public final class CashFlowStatementsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional companyId; @@ -50,7 +53,7 @@ public final class CashFlowStatementsListRequest { private final Map additionalProperties; private CashFlowStatementsListRequest( - Optional> expand, + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, @@ -82,7 +85,7 @@ private CashFlowStatementsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 companyId = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(CashFlowStatementsListRequest 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(CashFlowStatementsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CashFlowStatementsListRequest build() { return new CashFlowStatementsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequestExpandItem.java new file mode 100644 index 000000000..f8145575b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 CashFlowStatementsListRequestExpandItem { + public static final CashFlowStatementsListRequestExpandItem COMPANY = + new CashFlowStatementsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + CashFlowStatementsListRequestExpandItem(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 CashFlowStatementsListRequestExpandItem + && this.string.equals(((CashFlowStatementsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CashFlowStatementsListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new CashFlowStatementsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java index 0d8ccdfe8..bb32be047 100644 --- a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CashFlowStatementsRetrieveRequest.Builder.class) public final class CashFlowStatementsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class CashFlowStatementsRetrieveRequest { private final Map additionalProperties; private CashFlowStatementsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private CashFlowStatementsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(CashFlowStatementsRetrieveRequest 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(CashFlowStatementsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..9e3dd22d3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/CashFlowStatementsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 CashFlowStatementsRetrieveRequestExpandItem { + public static final CashFlowStatementsRetrieveRequestExpandItem COMPANY = + new CashFlowStatementsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + CashFlowStatementsRetrieveRequestExpandItem(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 CashFlowStatementsRetrieveRequestExpandItem + && this.string.equals(((CashFlowStatementsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CashFlowStatementsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new CashFlowStatementsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + 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..c339e2e78 100644 --- a/src/main/java/com/merge/api/accounting/types/CompanyInfo.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfo.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,61 +136,396 @@ public Optional getModifiedAt() { /** * @return The company's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The company's legal name. */ - @JsonProperty("legal_name") + @JsonIgnore public Optional getLegalName() { + if (legalName == null) { + return Optional.empty(); + } return legalName; } /** * @return The company's tax number. */ - @JsonProperty("tax_number") + @JsonIgnore public Optional getTaxNumber() { + if (taxNumber == null) { + return Optional.empty(); + } return taxNumber; } /** * @return The company's fiscal year end month. */ - @JsonProperty("fiscal_year_end_month") + @JsonIgnore public Optional getFiscalYearEndMonth() { + if (fiscalYearEndMonth == null) { + return Optional.empty(); + } return fiscalYearEndMonth; } /** * @return The company's fiscal year end day. */ - @JsonProperty("fiscal_year_end_day") + @JsonIgnore public Optional getFiscalYearEndDay() { + if (fiscalYearEndDay == null) { + return Optional.empty(); + } return fiscalYearEndDay; } - @JsonProperty("currency") + /** + * @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)
          • + *
          + */ + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return When the third party's company was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return The company's urls. */ - @JsonProperty("urls") + @JsonIgnore public Optional>> getUrls() { + if (urls == null) { + return Optional.empty(); + } return urls; } @@ -206,13 +547,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("legal_name") + private Optional _getLegalName() { + return legalName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_number") + private Optional _getTaxNumber() { + return taxNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fiscal_year_end_month") + private Optional _getFiscalYearEndMonth() { + return fiscalYearEndMonth; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fiscal_year_end_day") + private Optional _getFiscalYearEndDay() { + return fiscalYearEndDay; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("urls") + private Optional>> _getUrls() { + return urls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -365,6 +778,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -407,6 +831,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The company's legal name.

          */ @@ -421,6 +856,17 @@ public Builder legalName(String legalName) { return this; } + public Builder legalName(Nullable legalName) { + if (legalName.isNull()) { + this.legalName = null; + } else if (legalName.isEmpty()) { + this.legalName = Optional.empty(); + } else { + this.legalName = Optional.of(legalName.get()); + } + return this; + } + /** *

          The company's tax number.

          */ @@ -435,6 +881,17 @@ public Builder taxNumber(String taxNumber) { return this; } + public Builder taxNumber(Nullable taxNumber) { + if (taxNumber.isNull()) { + this.taxNumber = null; + } else if (taxNumber.isEmpty()) { + this.taxNumber = Optional.empty(); + } else { + this.taxNumber = Optional.of(taxNumber.get()); + } + return this; + } + /** *

          The company's fiscal year end month.

          */ @@ -449,6 +906,17 @@ public Builder fiscalYearEndMonth(Integer fiscalYearEndMonth) { return this; } + public Builder fiscalYearEndMonth(Nullable fiscalYearEndMonth) { + if (fiscalYearEndMonth.isNull()) { + this.fiscalYearEndMonth = null; + } else if (fiscalYearEndMonth.isEmpty()) { + this.fiscalYearEndMonth = Optional.empty(); + } else { + this.fiscalYearEndMonth = Optional.of(fiscalYearEndMonth.get()); + } + return this; + } + /** *

          The company's fiscal year end day.

          */ @@ -463,6 +931,328 @@ public Builder fiscalYearEndDay(Integer fiscalYearEndDay) { return this; } + public Builder fiscalYearEndDay(Nullable fiscalYearEndDay) { + if (fiscalYearEndDay.isNull()) { + this.fiscalYearEndDay = null; + } else if (fiscalYearEndDay.isEmpty()) { + this.fiscalYearEndDay = Optional.empty(); + } else { + this.fiscalYearEndDay = Optional.of(fiscalYearEndDay.get()); + } + 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) { this.currency = currency; @@ -474,6 +1264,17 @@ public Builder currency(JsonNode currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

          When the third party's company was created.

          */ @@ -488,6 +1289,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

          The company's urls.

          */ @@ -502,6 +1314,17 @@ public Builder urls(List> urls) { return this; } + public Builder urls(Nullable>> urls) { + if (urls.isNull()) { + this.urls = null; + } else if (urls.isEmpty()) { + this.urls = Optional.empty(); + } else { + this.urls = Optional.of(urls.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -549,6 +1372,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -560,6 +1394,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public CompanyInfo build() { return new CompanyInfo( id, 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..23347822f 100644 --- a/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CompanyInfoListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -157,8 +160,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -415,6 +427,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CompanyInfoListRequest build() { return new CompanyInfoListRequest( expand, 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..ab7ff670d 100644 --- a/src/main/java/com/merge/api/accounting/types/Contact.java +++ b/src/main/java/com/merge/api/accounting/types/Contact.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -114,8 +117,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -138,40 +144,55 @@ public Optional getModifiedAt() { /** * @return The contact's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return Whether the contact is a supplier. */ - @JsonProperty("is_supplier") + @JsonIgnore public Optional getIsSupplier() { + if (isSupplier == null) { + return Optional.empty(); + } return isSupplier; } /** * @return Whether the contact is a customer. */ - @JsonProperty("is_customer") + @JsonIgnore public Optional getIsCustomer() { + if (isCustomer == null) { + return Optional.empty(); + } return isCustomer; } /** * @return The contact's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The contact's tax number. */ - @JsonProperty("tax_number") + @JsonIgnore public Optional getTaxNumber() { + if (taxNumber == null) { + return Optional.empty(); + } return taxNumber; } @@ -182,32 +203,44 @@ public Optional getTaxNumber() { *
        • ARCHIVED - ARCHIVED
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The currency the contact's transactions are in. */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return When the third party's contact was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return The company the contact belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -235,13 +268,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -250,6 +289,78 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_supplier") + private Optional _getIsSupplier() { + return isSupplier; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_customer") + private Optional _getIsCustomer() { + return isCustomer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_number") + private Optional _getTaxNumber() { + return taxNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -409,6 +520,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -451,6 +573,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        Whether the contact is a supplier.

        */ @@ -465,6 +598,17 @@ public Builder isSupplier(Boolean isSupplier) { return this; } + public Builder isSupplier(Nullable isSupplier) { + if (isSupplier.isNull()) { + this.isSupplier = null; + } else if (isSupplier.isEmpty()) { + this.isSupplier = Optional.empty(); + } else { + this.isSupplier = Optional.of(isSupplier.get()); + } + return this; + } + /** *

        Whether the contact is a customer.

        */ @@ -479,6 +623,17 @@ public Builder isCustomer(Boolean isCustomer) { return this; } + public Builder isCustomer(Nullable isCustomer) { + if (isCustomer.isNull()) { + this.isCustomer = null; + } else if (isCustomer.isEmpty()) { + this.isCustomer = Optional.empty(); + } else { + this.isCustomer = Optional.of(isCustomer.get()); + } + return this; + } + /** *

        The contact's email address.

        */ @@ -493,6 +648,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

        The contact's tax number.

        */ @@ -507,6 +673,17 @@ public Builder taxNumber(String taxNumber) { return this; } + public Builder taxNumber(Nullable taxNumber) { + if (taxNumber.isNull()) { + this.taxNumber = null; + } else if (taxNumber.isEmpty()) { + this.taxNumber = Optional.empty(); + } else { + this.taxNumber = Optional.of(taxNumber.get()); + } + return this; + } + /** *

        The contact's status

        *
          @@ -525,6 +702,17 @@ public Builder status(ContactStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The currency the contact's transactions are in.

          */ @@ -539,6 +727,17 @@ public Builder currency(String currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

          When the third party's contact was updated.

          */ @@ -553,6 +752,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

          The company the contact belongs to.

          */ @@ -567,6 +777,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          Address object IDs for the given Contacts object.

          */ @@ -620,6 +841,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -631,6 +863,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..33b6dbb9f 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -84,40 +87,55 @@ private ContactRequest( /** * @return The contact's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return Whether the contact is a supplier. */ - @JsonProperty("is_supplier") + @JsonIgnore public Optional getIsSupplier() { + if (isSupplier == null) { + return Optional.empty(); + } return isSupplier; } /** * @return Whether the contact is a customer. */ - @JsonProperty("is_customer") + @JsonIgnore public Optional getIsCustomer() { + if (isCustomer == null) { + return Optional.empty(); + } return isCustomer; } /** * @return The contact's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The contact's tax number. */ - @JsonProperty("tax_number") + @JsonIgnore public Optional getTaxNumber() { + if (taxNumber == null) { + return Optional.empty(); + } return taxNumber; } @@ -128,24 +146,33 @@ public Optional getTaxNumber() { *
        • ARCHIVED - ARCHIVED
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The currency the contact's transactions are in. */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The company the contact belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -165,13 +192,19 @@ public Optional> getPhoneNumbers() { return phoneNumbers; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -180,6 +213,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_supplier") + private Optional _getIsSupplier() { + return isSupplier; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_customer") + private Optional _getIsCustomer() { + return isCustomer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_number") + private Optional _getTaxNumber() { + return taxNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -298,6 +391,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        Whether the contact is a supplier.

        */ @@ -312,6 +416,17 @@ public Builder isSupplier(Boolean isSupplier) { return this; } + public Builder isSupplier(Nullable isSupplier) { + if (isSupplier.isNull()) { + this.isSupplier = null; + } else if (isSupplier.isEmpty()) { + this.isSupplier = Optional.empty(); + } else { + this.isSupplier = Optional.of(isSupplier.get()); + } + return this; + } + /** *

        Whether the contact is a customer.

        */ @@ -326,6 +441,17 @@ public Builder isCustomer(Boolean isCustomer) { return this; } + public Builder isCustomer(Nullable isCustomer) { + if (isCustomer.isNull()) { + this.isCustomer = null; + } else if (isCustomer.isEmpty()) { + this.isCustomer = Optional.empty(); + } else { + this.isCustomer = Optional.of(isCustomer.get()); + } + return this; + } + /** *

        The contact's email address.

        */ @@ -340,6 +466,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

        The contact's tax number.

        */ @@ -354,6 +491,17 @@ public Builder taxNumber(String taxNumber) { return this; } + public Builder taxNumber(Nullable taxNumber) { + if (taxNumber.isNull()) { + this.taxNumber = null; + } else if (taxNumber.isEmpty()) { + this.taxNumber = Optional.empty(); + } else { + this.taxNumber = Optional.of(taxNumber.get()); + } + return this; + } + /** *

        The contact's status

        *
          @@ -372,6 +520,17 @@ public Builder status(ContactRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The currency the contact's transactions are in.

          */ @@ -386,6 +545,17 @@ public Builder currency(String currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

          The company the contact belongs to.

          */ @@ -400,6 +570,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          Address object IDs for the given Contacts object.

          */ @@ -439,6 +620,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -450,6 +642,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..9047abb94 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -55,11 +58,11 @@ public final class ContactsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional status; @@ -82,9 +85,9 @@ private ContactsListRequest( Optional modifiedBefore, Optional name, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional status, Map additionalProperties) { this.expand = expand; @@ -153,8 +156,11 @@ public Optional getCursor() { /** * @return If provided, will only return Contacts that match this email. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } @@ -225,8 +231,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return Contacts that match this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -242,15 +251,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -258,15 +270,42 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } /** * @return If provided, will only return Contacts that match this status. */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -372,11 +411,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional status = Optional.empty(); @@ -498,6 +537,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + 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.

          */ @@ -624,6 +674,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ @@ -642,12 +703,12 @@ public Builder pageSize(Integer pageSize) { *

          Deprecated. Use show_enum_origins.

          */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(ContactsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -666,16 +727,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ContactsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } @@ -694,6 +766,17 @@ public Builder status(ContactsListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public ContactsListRequest build() { return new ContactsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/ContactsListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/ContactsListRequestRemoteFields.java new file mode 100644 index 000000000..b204480bf --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsListRequestRemoteFields { + public static final ContactsListRequestRemoteFields STATUS = + new ContactsListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ContactsListRequestRemoteFields(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 ContactsListRequestRemoteFields + && this.string.equals(((ContactsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ContactsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/ContactsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..53af39531 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsListRequestShowEnumOrigins { + public static final ContactsListRequestShowEnumOrigins STATUS = + new ContactsListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ContactsListRequestShowEnumOrigins(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 ContactsListRequestShowEnumOrigins + && this.string.equals(((ContactsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ContactsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..addb80878 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java index 995d67fc7..06df176b8 100644 --- a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequest.java @@ -30,9 +30,9 @@ public final class ContactsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -41,8 +41,8 @@ private ContactsRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -89,7 +89,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -97,7 +97,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -151,9 +151,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -235,12 +235,12 @@ public Builder includeShellData(Boolean includeShellData) { *

          Deprecated. Use show_enum_origins.

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

          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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ContactsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..79db034d3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsRetrieveRequestRemoteFields { + public static final ContactsRetrieveRequestRemoteFields STATUS = + new ContactsRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ContactsRetrieveRequestRemoteFields(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 ContactsRetrieveRequestRemoteFields + && this.string.equals(((ContactsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ContactsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..d30c17e7b --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ContactsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsRetrieveRequestShowEnumOrigins { + public static final ContactsRetrieveRequestShowEnumOrigins STATUS = + new ContactsRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ContactsRetrieveRequestShowEnumOrigins(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 ContactsRetrieveRequestShowEnumOrigins + && this.string.equals(((ContactsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ContactsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..8171883b6 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNote.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNote.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -138,8 +141,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -162,8 +168,11 @@ public Optional getModifiedAt() { /** * @return The credit note's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } @@ -175,64 +184,88 @@ public Optional getTransactionDate() { *
        • PAID - PAID
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The credit note's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The credit note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The company the credit note belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The credit note's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The credit note's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The amount of value remaining in the credit note that the customer can use. */ - @JsonProperty("remaining_credit") + @JsonIgnore public Optional getRemainingCredit() { + if (remainingCredit == null) { + return Optional.empty(); + } return remainingCredit; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -557,24 +590,33 @@ public Optional>> getTrackingCat *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return When the third party's credit note was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's credit note was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -597,8 +639,11 @@ public Optional>> getAppliedPayment /** * @return The accounting period that the CreditNote was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -618,13 +663,115 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remaining_credit") + private Optional _getRemainingCredit() { + return remainingCredit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -817,6 +964,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -859,6 +1017,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      The credit note's status.

      *
        @@ -878,6 +1047,17 @@ public Builder status(CreditNoteStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

        The credit note's number.

        */ @@ -892,6 +1072,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

        The credit note's contact.

        */ @@ -906,6 +1097,17 @@ public Builder contact(CreditNoteContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The company the credit note belongs to.

        */ @@ -920,6 +1122,17 @@ public Builder company(CreditNoteCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The credit note's exchange rate.

        */ @@ -934,6 +1147,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The credit note's total amount.

        */ @@ -948,6 +1172,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

        The amount of value remaining in the credit note that the customer can use.

        */ @@ -962,6 +1197,17 @@ public Builder remainingCredit(Double remainingCredit) { return this; } + public Builder remainingCredit(Nullable remainingCredit) { + if (remainingCredit.isNull()) { + this.remainingCredit = null; + } else if (remainingCredit.isEmpty()) { + this.remainingCredit = Optional.empty(); + } else { + this.remainingCredit = Optional.of(remainingCredit.get()); + } + return this; + } + /** *

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

        */ @@ -976,6 +1222,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; @@ -1321,6 +1578,17 @@ public Builder currency(CreditNoteCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        When the third party's credit note was created.

        */ @@ -1335,6 +1603,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the third party's credit note was updated.

        */ @@ -1349,6 +1628,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

        Array of Payment object IDs

        */ @@ -1391,6 +1681,17 @@ public Builder accountingPeriod(CreditNoteAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

        A list of the CreditNote Applied to Lines common models related to a given Credit Note

        */ @@ -1430,6 +1731,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1441,6 +1753,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public CreditNote build() { return new CreditNote( id, diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNote.java b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNote.java index 23fa7d11e..2b7b9d965 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNote.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNote.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -59,8 +62,11 @@ private CreditNoteApplyLineForCreditNote( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -80,24 +86,33 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("invoice") + @JsonIgnore public Optional getInvoice() { + if (invoice == null) { + return Optional.empty(); + } return invoice; } /** * @return Date that the credit note is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the Credit Note applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } @@ -109,6 +124,30 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("invoice") + private Optional _getInvoice() { + return invoice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -197,6 +236,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -236,6 +286,17 @@ public Builder invoice(CreditNoteApplyLineForCreditNoteInvoice invoice) { return this; } + public Builder invoice(Nullable invoice) { + if (invoice.isNull()) { + this.invoice = null; + } else if (invoice.isEmpty()) { + this.invoice = Optional.empty(); + } else { + this.invoice = Optional.of(invoice.get()); + } + return this; + } + /** *

        Date that the credit note is applied to the invoice.

        */ @@ -250,6 +311,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the Credit Note applied to the invoice.

        */ @@ -264,6 +336,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java index f256595b0..3b1ae2971 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForCreditNoteRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -56,39 +59,93 @@ private CreditNoteApplyLineForCreditNoteRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } - @JsonProperty("invoice") + @JsonIgnore public Optional getInvoice() { + if (invoice == null) { + return Optional.empty(); + } return invoice; } /** * @return Date that the credit note is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the Credit Note applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("invoice") + private Optional _getInvoice() { + return invoice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -176,6 +233,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + @JsonSetter(value = "invoice", nulls = Nulls.SKIP) public Builder invoice(Optional invoice) { this.invoice = invoice; @@ -187,6 +255,17 @@ public Builder invoice(CreditNoteApplyLineForCreditNoteRequestInvoice invoice) { return this; } + public Builder invoice(Nullable invoice) { + if (invoice.isNull()) { + this.invoice = null; + } else if (invoice.isEmpty()) { + this.invoice = Optional.empty(); + } else { + this.invoice = Optional.of(invoice.get()); + } + return this; + } + /** *

        Date that the credit note is applied to the invoice.

        */ @@ -201,6 +280,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the Credit Note applied to the invoice.

        */ @@ -215,6 +305,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -226,6 +327,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -237,6 +349,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CreditNoteApplyLineForCreditNoteRequest build() { return new CreditNoteApplyLineForCreditNoteRequest( remoteId, diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForInvoice.java b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForInvoice.java index 7b6228362..9caad2de4 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForInvoice.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteApplyLineForInvoice.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -59,8 +62,11 @@ private CreditNoteApplyLineForInvoice( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -80,24 +86,33 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("credit_note") + @JsonIgnore public Optional getCreditNote() { + if (creditNote == null) { + return Optional.empty(); + } return creditNote; } /** * @return Date that the credit note is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the Credit Note applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } @@ -109,6 +124,30 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credit_note") + private Optional _getCreditNote() { + return creditNote; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -197,6 +236,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -236,6 +286,17 @@ public Builder creditNote(CreditNoteApplyLineForInvoiceCreditNote creditNote) { return this; } + public Builder creditNote(Nullable creditNote) { + if (creditNote.isNull()) { + this.creditNote = null; + } else if (creditNote.isEmpty()) { + this.creditNote = Optional.empty(); + } else { + this.creditNote = Optional.of(creditNote.get()); + } + return this; + } + /** *

        Date that the credit note is applied to the invoice.

        */ @@ -250,6 +311,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the Credit Note applied to the invoice.

        */ @@ -264,6 +336,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java index d189295d6..aa6afcace 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItem.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,8 +116,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,72 +140,99 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The credit note line item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The description of the item that is owed. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The credit note line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } /** * @return The credit note line item's memo. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The credit note line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The credit note line item's total. */ - @JsonProperty("total_line_amount") + @JsonIgnore public Optional getTotalLineAmount() { + if (totalLineAmount == null) { + return Optional.empty(); + } return totalLineAmount; } /** * @return The credit note line item's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -214,29 +247,41 @@ public Optional>> getTrackingCategories() { /** * @return The credit note line item's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The company the credit note belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The credit note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } @@ -248,6 +293,90 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_line_amount") + private Optional _getTotalLineAmount() { + return totalLineAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -407,6 +536,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -446,6 +586,17 @@ public Builder item(CreditNoteLineItemItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

        The credit note line item's name.

        */ @@ -460,6 +611,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The description of the item that is owed.

        */ @@ -474,6 +636,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The credit note line item's quantity.

        */ @@ -488,6 +661,17 @@ public Builder quantity(String quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + /** *

        The credit note line item's memo.

        */ @@ -502,6 +686,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

        The credit note line item's unit price.

        */ @@ -516,6 +711,17 @@ public Builder unitPrice(String unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -530,6 +736,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

        The credit note line item's total.

        */ @@ -544,6 +761,17 @@ public Builder totalLineAmount(String totalLineAmount) { return this; } + public Builder totalLineAmount(Nullable totalLineAmount) { + if (totalLineAmount.isNull()) { + this.totalLineAmount = null; + } else if (totalLineAmount.isEmpty()) { + this.totalLineAmount = Optional.empty(); + } else { + this.totalLineAmount = Optional.of(totalLineAmount.get()); + } + return this; + } + /** *

        The credit note line item's associated tracking category.

        */ @@ -558,6 +786,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The credit note line item's associated tracking categories.

        */ @@ -586,6 +825,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The company the credit note belongs to.

        */ @@ -600,6 +850,17 @@ public Builder company(CreditNoteLineItemCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The credit note's contact.

        */ @@ -614,6 +875,17 @@ public Builder contact(CreditNoteLineItemContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -625,6 +897,17 @@ public Builder project(CreditNoteLineItemProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java index 485ca5d1c..e331c414b 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteLineItemRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -100,77 +103,107 @@ private CreditNoteLineItemRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The credit note line item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The description of the item that is owed. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The credit note line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } /** * @return The credit note line item's memo. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The credit note line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The credit note line item's total. */ - @JsonProperty("total_line_amount") + @JsonIgnore public Optional getTotalLineAmount() { + if (totalLineAmount == null) { + return Optional.empty(); + } return totalLineAmount; } /** * @return The credit note line item's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -185,39 +218,153 @@ public Optional>> getTrackingCategories() { /** * @return The credit note line item's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The company the credit note belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The credit note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_line_amount") + private Optional _getTotalLineAmount() { + return totalLineAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -359,6 +506,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -370,6 +528,17 @@ public Builder item(CreditNoteLineItemRequestItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

        The credit note line item's name.

        */ @@ -384,6 +553,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The description of the item that is owed.

        */ @@ -398,6 +578,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The credit note line item's quantity.

        */ @@ -412,6 +603,17 @@ public Builder quantity(String quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + /** *

        The credit note line item's memo.

        */ @@ -426,6 +628,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

        The credit note line item's unit price.

        */ @@ -440,6 +653,17 @@ public Builder unitPrice(String unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -454,6 +678,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

        The credit note line item's total.

        */ @@ -468,6 +703,17 @@ public Builder totalLineAmount(String totalLineAmount) { return this; } + public Builder totalLineAmount(Nullable totalLineAmount) { + if (totalLineAmount.isNull()) { + this.totalLineAmount = null; + } else if (totalLineAmount.isEmpty()) { + this.totalLineAmount = Optional.empty(); + } else { + this.totalLineAmount = Optional.of(totalLineAmount.get()); + } + return this; + } + /** *

        The credit note line item's associated tracking category.

        */ @@ -482,6 +728,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The credit note line item's associated tracking categories.

        */ @@ -510,6 +767,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The company the credit note belongs to.

        */ @@ -524,6 +792,17 @@ public Builder company(CreditNoteLineItemRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The credit note's contact.

        */ @@ -538,6 +817,17 @@ public Builder contact(CreditNoteLineItemRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -549,6 +839,17 @@ public Builder project(CreditNoteLineItemRequestProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -560,6 +861,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -571,6 +883,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CreditNoteLineItemRequest build() { return new CreditNoteLineItemRequest( remoteId, diff --git a/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java b/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java index 46176b432..bd15388c1 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNoteRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -105,8 +108,11 @@ private CreditNoteRequest( /** * @return The credit note's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } @@ -118,64 +124,88 @@ public Optional getTransactionDate() { *
      • PAID - PAID
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The credit note's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The credit note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The company the credit note belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The credit note's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The credit note's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The amount of value remaining in the credit note that the customer can use. */ - @JsonProperty("remaining_credit") + @JsonIgnore public Optional getRemainingCredit() { + if (remainingCredit == null) { + return Optional.empty(); + } return remainingCredit; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -500,8 +530,11 @@ public Optional>> getTrac *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } @@ -524,8 +557,11 @@ public Optional>> getApplied /** * @return The accounting period that the CreditNote was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -537,13 +573,97 @@ public Optional> getAppliedToLines return appliedToLines; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remaining_credit") + private Optional _getRemainingCredit() { + return remainingCredit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -690,6 +810,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    The credit note's status.

    *
      @@ -709,6 +840,17 @@ public Builder status(CreditNoteRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The credit note's number.

      */ @@ -723,6 +865,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

      The credit note's contact.

      */ @@ -737,6 +890,17 @@ public Builder contact(CreditNoteRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The company the credit note belongs to.

      */ @@ -751,6 +915,17 @@ public Builder company(CreditNoteRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The credit note's exchange rate.

      */ @@ -765,6 +940,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The credit note's total amount.

      */ @@ -779,6 +965,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The amount of value remaining in the credit note that the customer can use.

      */ @@ -793,6 +990,17 @@ public Builder remainingCredit(Double remainingCredit) { return this; } + public Builder remainingCredit(Nullable remainingCredit) { + if (remainingCredit.isNull()) { + this.remainingCredit = null; + } else if (remainingCredit.isEmpty()) { + this.remainingCredit = Optional.empty(); + } else { + this.remainingCredit = Optional.of(remainingCredit.get()); + } + return this; + } + /** *

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

      */ @@ -807,6 +1015,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; @@ -1152,6 +1371,17 @@ public Builder currency(CreditNoteRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      Array of Payment object IDs

      */ @@ -1194,6 +1424,17 @@ public Builder accountingPeriod(CreditNoteRequestAccountingPeriod accountingPeri return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

      A list of the CreditNote Applied to Lines common models related to a given Credit Note

      */ @@ -1219,6 +1460,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1230,6 +1482,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CreditNoteRequest build() { return new CreditNoteRequest( transactionDate, 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..04a4562e5 100644 --- a/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/CreditNotesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -193,8 +196,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -209,16 +215,40 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -528,6 +558,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

      */ @@ -556,6 +597,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

      */ @@ -570,6 +622,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public CreditNotesListRequest build() { return new CreditNotesListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java index 4f79e923c..721cbadeb 100644 --- a/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/accounting/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

      The data with the request. You must include a request_format parameter matching the data's format

      */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

      Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

      */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

      */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

      */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. 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..010feae3b 100644 --- a/src/main/java/com/merge/api/accounting/types/Employee.java +++ b/src/main/java/com/merge/api/accounting/types/Employee.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -95,8 +98,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -119,48 +125,66 @@ public Optional getModifiedAt() { /** * @return The employee's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The employee's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return True if the employee is a contractor, False if not. */ - @JsonProperty("is_contractor") + @JsonIgnore public Optional getIsContractor() { + if (isContractor == null) { + return Optional.empty(); + } return isContractor; } /** * @return The employee's internal identification number. */ - @JsonProperty("employee_number") + @JsonIgnore public Optional getEmployeeNumber() { + if (employeeNumber == null) { + return Optional.empty(); + } return employeeNumber; } /** * @return The employee's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The subsidiary that the employee belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -184,13 +208,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_contractor") + private Optional _getIsContractor() { + return isContractor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_number") + private Optional _getEmployeeNumber() { + return employeeNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -277,6 +361,8 @@ public interface _FinalStage { _FinalStage remoteId(String remoteId); + _FinalStage remoteId(Nullable remoteId); + /** *

      The datetime that this object was created by Merge.

      */ @@ -298,6 +384,8 @@ public interface _FinalStage { _FinalStage firstName(String firstName); + _FinalStage firstName(Nullable firstName); + /** *

      The employee's last name.

      */ @@ -305,6 +393,8 @@ public interface _FinalStage { _FinalStage lastName(String lastName); + _FinalStage lastName(Nullable lastName); + /** *

      True if the employee is a contractor, False if not.

      */ @@ -312,6 +402,8 @@ public interface _FinalStage { _FinalStage isContractor(Boolean isContractor); + _FinalStage isContractor(Nullable isContractor); + /** *

      The employee's internal identification number.

      */ @@ -319,6 +411,8 @@ public interface _FinalStage { _FinalStage employeeNumber(String employeeNumber); + _FinalStage employeeNumber(Nullable employeeNumber); + /** *

      The employee's email address.

      */ @@ -326,6 +420,8 @@ public interface _FinalStage { _FinalStage emailAddress(String emailAddress); + _FinalStage emailAddress(Nullable emailAddress); + /** *

      The subsidiary that the employee belongs to.

      */ @@ -333,6 +429,8 @@ public interface _FinalStage { _FinalStage company(EmployeeCompany company); + _FinalStage company(Nullable company); + /** *

      Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more.

      */ @@ -344,9 +442,13 @@ public interface _FinalStage { _FinalStage fieldMappings(Map fieldMappings); + _FinalStage fieldMappings(Nullable> fieldMappings); + _FinalStage remoteData(Optional> remoteData); _FinalStage remoteData(List remoteData); + + _FinalStage remoteData(Nullable> remoteData); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -423,6 +525,18 @@ public _FinalStage status(@NotNull EmployeeStatus status) { return this; } + @java.lang.Override + public _FinalStage remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteData(List remoteData) { this.remoteData = Optional.ofNullable(remoteData); @@ -436,6 +550,18 @@ public _FinalStage remoteData(Optional> remoteData) { return this; } + @java.lang.Override + public _FinalStage fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @java.lang.Override public _FinalStage fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.ofNullable(fieldMappings); @@ -469,6 +595,22 @@ public _FinalStage remoteWasDeleted(Optional remoteWasDeleted) { return this; } + /** + *

      The subsidiary that the employee belongs to.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The subsidiary that the employee belongs to.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -489,6 +631,22 @@ public _FinalStage company(Optional company) { return this; } + /** + *

      The employee's email address.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

      The employee's email address.

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

      The employee's internal identification number.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage employeeNumber(Nullable employeeNumber) { + if (employeeNumber.isNull()) { + this.employeeNumber = null; + } else if (employeeNumber.isEmpty()) { + this.employeeNumber = Optional.empty(); + } else { + this.employeeNumber = Optional.of(employeeNumber.get()); + } + return this; + } + /** *

      The employee's internal identification number.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -529,6 +703,22 @@ public _FinalStage employeeNumber(Optional employeeNumber) { return this; } + /** + *

      True if the employee is a contractor, False if not.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage isContractor(Nullable isContractor) { + if (isContractor.isNull()) { + this.isContractor = null; + } else if (isContractor.isEmpty()) { + this.isContractor = Optional.empty(); + } else { + this.isContractor = Optional.of(isContractor.get()); + } + return this; + } + /** *

      True if the employee is a contractor, False if not.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -549,6 +739,22 @@ public _FinalStage isContractor(Optional isContractor) { return this; } + /** + *

      The employee's last name.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

      The employee's last name.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -569,6 +775,22 @@ public _FinalStage lastName(Optional lastName) { return this; } + /** + *

      The employee's first name.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

      The employee's first name.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -629,6 +851,22 @@ public _FinalStage createdAt(Optional createdAt) { return this; } + /** + *

      The third-party API ID of the matching object.

      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The third-party API ID of the matching object.

      * @return Reference to {@code this} so that method calls can be chained together. 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..0dbd05af7 100644 --- a/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/EmployeesListRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EmployeesListRequest.Builder.class) public final class EmployeesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional cursor; @@ -37,7 +37,7 @@ public final class EmployeesListRequest { private final Map additionalProperties; private EmployeesListRequest( - Optional> expand, + Optional> expand, Optional cursor, Optional includeDeletedData, Optional includeRemoteData, @@ -57,7 +57,7 @@ private EmployeesListRequest( * @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; } @@ -143,7 +143,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 cursor = Optional.empty(); @@ -174,17 +174,17 @@ public Builder from(EmployeesListRequest 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(EmployeesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/EmployeesListRequestExpandItem.java new file mode 100644 index 000000000..1d7fe5c3c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EmployeesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 EmployeesListRequestExpandItem { + public static final EmployeesListRequestExpandItem COMPANY = + new EmployeesListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + EmployeesListRequestExpandItem(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 EmployeesListRequestExpandItem + && this.string.equals(((EmployeesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EmployeesListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new EmployeesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java index cce06cf03..b68de4ec1 100644 --- a/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EmployeesRetrieveRequest.Builder.class) public final class EmployeesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class EmployeesRetrieveRequest { private final Map additionalProperties; private EmployeesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private EmployeesRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(EmployeesRetrieveRequest 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(EmployeesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..4d4709e41 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/EmployeesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 EmployeesRetrieveRequestExpandItem { + public static final EmployeesRetrieveRequestExpandItem COMPANY = + new EmployeesRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + EmployeesRetrieveRequestExpandItem(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 EmployeesRetrieveRequestExpandItem + && this.string.equals(((EmployeesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EmployeesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new EmployeesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/EncodingEnum.java b/src/main/java/com/merge/api/accounting/types/EncodingEnum.java index e01847282..05ab08829 100644 --- a/src/main/java/com/merge/api/accounting/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/accounting/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } 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..1fcda392e 100644 --- a/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/accounting/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
    • de - de
    • *
    */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

    */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

    */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

    */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

    */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

    The following subset of IETF language tags can be used to configure localization.

    *
      @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

      The boolean that indicates whether initial, periodic, and force syncs will be disabled.

      */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

      A JSON object containing integration-specific configuration options.

      */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

      A JSON object containing integration-specific configuration options.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

      The following subset of IETF language tags can be used to configure localization.

      + *
        + *
      • en - en
      • + *
      • de - de
      • + *
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

      The following subset of IETF language tags can be used to configure localization.

      *
        @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/accounting/types/Expense.java b/src/main/java/com/merge/api/accounting/types/Expense.java index 3c386a556..359866c1c 100644 --- a/src/main/java/com/merge/api/accounting/types/Expense.java +++ b/src/main/java/com/merge/api/accounting/types/Expense.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -134,8 +137,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -158,56 +164,77 @@ public Optional getModifiedAt() { /** * @return When the transaction occurred. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return When the expense was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return The expense's payment account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The expense's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The expense's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The expense's total amount before tax. */ - @JsonProperty("sub_total") + @JsonIgnore public Optional getSubTotal() { + if (subTotal == null) { + return Optional.empty(); + } return subTotal; } /** * @return The expense's total tax amount. */ - @JsonProperty("total_tax_amount") + @JsonIgnore public Optional getTotalTaxAmount() { + if (totalTaxAmount == null) { + return Optional.empty(); + } return totalTaxAmount; } @@ -522,48 +549,66 @@ public Optional getTotalTaxAmount() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The expense's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The company the expense belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The expense's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } @@ -588,18 +633,27 @@ public Optional getRemoteWasDeleted() { /** * @return The accounting period that the Expense was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -608,6 +662,108 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sub_total") + private Optional _getSubTotal() { + return subTotal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_tax_amount") + private Optional _getTotalTaxAmount() { + return totalTaxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -792,6 +948,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -834,6 +1001,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      When the expense was created.

      */ @@ -848,6 +1026,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

      The expense's payment account.

      */ @@ -862,6 +1051,17 @@ public Builder account(ExpenseAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The expense's contact.

      */ @@ -876,6 +1076,17 @@ public Builder contact(ExpenseContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The expense's total amount.

      */ @@ -890,6 +1101,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The expense's total amount before tax.

      */ @@ -904,6 +1126,17 @@ public Builder subTotal(Double subTotal) { return this; } + public Builder subTotal(Nullable subTotal) { + if (subTotal.isNull()) { + this.subTotal = null; + } else if (subTotal.isEmpty()) { + this.subTotal = Optional.empty(); + } else { + this.subTotal = Optional.of(subTotal.get()); + } + return this; + } + /** *

      The expense's total tax amount.

      */ @@ -918,6 +1151,17 @@ public Builder totalTaxAmount(Double totalTaxAmount) { return this; } + public Builder totalTaxAmount(Nullable totalTaxAmount) { + if (totalTaxAmount.isNull()) { + this.totalTaxAmount = null; + } else if (totalTaxAmount.isEmpty()) { + this.totalTaxAmount = Optional.empty(); + } else { + this.totalTaxAmount = Optional.of(totalTaxAmount.get()); + } + return this; + } + /** *

      The expense's currency.

      *
        @@ -1240,6 +1484,17 @@ public Builder currency(ExpenseCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The expense's exchange rate.

        */ @@ -1254,6 +1509,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

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

        */ @@ -1268,6 +1534,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

        The company the expense belongs to.

        */ @@ -1282,6 +1559,17 @@ public Builder company(ExpenseCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The employee this overall transaction relates to.

        */ @@ -1296,6 +1584,17 @@ public Builder employee(ExpenseEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

        The expense's private note.

        */ @@ -1310,6 +1609,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + @JsonSetter(value = "lines", nulls = Nulls.SKIP) public Builder lines(Optional> lines) { this.lines = lines; @@ -1360,6 +1670,17 @@ public Builder accountingPeriod(ExpenseAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -1371,6 +1692,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1382,6 +1714,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..81e9b5732 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseLine.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLine.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -109,8 +112,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -133,21 +139,30 @@ public Optional getModifiedAt() { /** * @return The line's item. */ - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The line's net amount. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -162,16 +177,22 @@ public Optional>> getTrackingCa /** * @return The company the expense belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } @@ -486,53 +507,74 @@ public Optional getEmployee() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The expense's payment account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The expense's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } /** * @return The description of the item that was purchased by the company. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The expense line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } @@ -544,6 +586,84 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -698,6 +818,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -740,6 +871,17 @@ public Builder item(ExpenseLineItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

      The line's net amount.

      */ @@ -754,6 +896,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -765,6 +918,17 @@ public Builder trackingCategory(ExpenseLineTrackingCategory trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

      The expense line item's associated tracking categories.

      */ @@ -794,6 +958,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The employee this overall transaction relates to.

      */ @@ -808,6 +983,17 @@ public Builder employee(ExpenseLineEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

      The expense line item's currency.

      *
        @@ -1130,6 +1316,17 @@ public Builder currency(TransactionCurrencyEnum currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The expense's payment account.

        */ @@ -1144,6 +1341,17 @@ public Builder account(ExpenseLineAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The expense's contact.

        */ @@ -1158,6 +1366,17 @@ public Builder contact(ExpenseLineContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -1169,6 +1388,17 @@ public Builder project(ExpenseLineProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + /** *

        The description of the item that was purchased by the company.

        */ @@ -1183,6 +1413,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The expense line item's exchange rate.

        */ @@ -1197,6 +1438,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -1211,6 +1463,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + 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.

        */ 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..1c11a7b44 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseLineRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -100,29 +103,41 @@ private ExpenseLineRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return The line's item. */ - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The line's net amount. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -137,16 +152,22 @@ public Optional>> getTra /** * @return The company the expense belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } @@ -461,63 +482,90 @@ public Optional getEmployee() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The expense's payment account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The expense's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } /** * @return The description of the item that was purchased by the company. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The expense line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -526,6 +574,96 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -665,6 +803,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The line's item.

      */ @@ -679,6 +828,17 @@ public Builder item(ExpenseLineRequestItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

      The line's net amount.

      */ @@ -693,6 +853,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -704,6 +875,17 @@ public Builder trackingCategory(ExpenseLineRequestTrackingCategory trackingCateg return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

      The expense line item's associated tracking categories.

      */ @@ -733,6 +915,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The employee this overall transaction relates to.

      */ @@ -747,6 +940,17 @@ public Builder employee(ExpenseLineRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

      The expense line item's currency.

      *
        @@ -1069,6 +1273,17 @@ public Builder currency(ExpenseLineRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The expense's payment account.

        */ @@ -1083,6 +1298,17 @@ public Builder account(ExpenseLineRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The expense's contact.

        */ @@ -1097,6 +1323,17 @@ public Builder contact(ExpenseLineRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -1108,6 +1345,17 @@ public Builder project(ExpenseLineRequestProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + /** *

        The description of the item that was purchased by the company.

        */ @@ -1122,6 +1370,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The expense line item's exchange rate.

        */ @@ -1136,6 +1395,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -1150,6 +1420,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1161,6 +1442,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1172,6 +1464,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..ace9d6b19 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpenseRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -105,48 +108,66 @@ private ExpenseRequest( /** * @return When the transaction occurred. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The expense's payment account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The expense's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The expense's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The expense's total amount before tax. */ - @JsonProperty("sub_total") + @JsonIgnore public Optional getSubTotal() { + if (subTotal == null) { + return Optional.empty(); + } return subTotal; } /** * @return The expense's total tax amount. */ - @JsonProperty("total_tax_amount") + @JsonIgnore public Optional getTotalTaxAmount() { + if (totalTaxAmount == null) { + return Optional.empty(); + } return totalTaxAmount; } @@ -461,48 +482,66 @@ public Optional getTotalTaxAmount() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The expense's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The company the expense belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The expense's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } @@ -519,18 +558,27 @@ public Optional>> getTrackin /** * @return The accounting period that the Expense was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -539,6 +587,96 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sub_total") + private Optional _getSubTotal() { + return subTotal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_tax_amount") + private Optional _getTotalTaxAmount() { + return totalTaxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -682,6 +820,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      The expense's payment account.

      */ @@ -696,6 +845,17 @@ public Builder account(ExpenseRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The expense's contact.

      */ @@ -710,6 +870,17 @@ public Builder contact(ExpenseRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The expense's total amount.

      */ @@ -724,6 +895,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The expense's total amount before tax.

      */ @@ -738,6 +920,17 @@ public Builder subTotal(Double subTotal) { return this; } + public Builder subTotal(Nullable subTotal) { + if (subTotal.isNull()) { + this.subTotal = null; + } else if (subTotal.isEmpty()) { + this.subTotal = Optional.empty(); + } else { + this.subTotal = Optional.of(subTotal.get()); + } + return this; + } + /** *

      The expense's total tax amount.

      */ @@ -752,6 +945,17 @@ public Builder totalTaxAmount(Double totalTaxAmount) { return this; } + public Builder totalTaxAmount(Nullable totalTaxAmount) { + if (totalTaxAmount.isNull()) { + this.totalTaxAmount = null; + } else if (totalTaxAmount.isEmpty()) { + this.totalTaxAmount = Optional.empty(); + } else { + this.totalTaxAmount = Optional.of(totalTaxAmount.get()); + } + return this; + } + /** *

      The expense's currency.

      *
        @@ -1074,6 +1278,17 @@ public Builder currency(TransactionCurrencyEnum currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The expense's exchange rate.

        */ @@ -1088,6 +1303,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

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

        */ @@ -1102,6 +1328,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

        The company the expense belongs to.

        */ @@ -1116,6 +1353,17 @@ public Builder company(ExpenseRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The employee this overall transaction relates to.

        */ @@ -1130,6 +1378,17 @@ public Builder employee(ExpenseRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

        The expense's private note.

        */ @@ -1144,6 +1403,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + @JsonSetter(value = "lines", nulls = Nulls.SKIP) public Builder lines(Optional> lines) { this.lines = lines; @@ -1181,6 +1451,17 @@ public Builder accountingPeriod(ExpenseRequestAccountingPeriod accountingPeriod) return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1192,6 +1473,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1203,6 +1495,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..164505657 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesLinesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..ae56ddc03 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -189,24 +192,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -511,6 +541,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

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

        */ @@ -525,6 +566,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

        */ @@ -539,6 +591,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public ExpensesListRequest build() { return new ExpensesListRequest( expand, 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..1d7447560 100644 --- a/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ExpensesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java index 085d477c4..590f867fd 100644 --- a/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/accounting/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); } 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..a230dbfd9 100644 --- a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java index d62f589f3..0e47c3cff 100644 --- a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index d67c1db6b..7414ac99b 100644 --- a/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/accounting/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/accounting/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..7fe2ca29f --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java index bf3c4003a..a4ed447ec 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransaction.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -103,8 +106,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -127,8 +133,11 @@ public Optional getModifiedAt() { /** * @return The third party remote ID of the underlying transaction. */ - @JsonProperty("underlying_transaction_remote_id") + @JsonIgnore public Optional getUnderlyingTransactionRemoteId() { + if (underlyingTransactionRemoteId == null) { + return Optional.empty(); + } return underlyingTransactionRemoteId; } @@ -144,40 +153,55 @@ public Optional getUnderlyingTransactionRemoteId() { *
      • CREDIT_NOTE - CREDIT_NOTE
      • *
      */ - @JsonProperty("underlying_transaction_type") + @JsonIgnore public Optional getUnderlyingTransactionType() { + if (underlyingTransactionType == null) { + return Optional.empty(); + } return underlyingTransactionType; } /** * @return The accounting period that the GeneralLedgerTransaction was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } /** * @return The company the GeneralLedgerTransaction belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return When the third party's GeneralLedgerTransaction entry was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the third party's GeneralLedgerTransaction entry was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -189,8 +213,11 @@ public Optional>> /** * @return The date that the transaction was posted to the general ledger. */ - @JsonProperty("posting_date") + @JsonIgnore public Optional getPostingDate() { + if (postingDate == null) { + return Optional.empty(); + } return postingDate; } @@ -211,13 +238,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("underlying_transaction_remote_id") + private Optional _getUnderlyingTransactionRemoteId() { + return underlyingTransactionRemoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("underlying_transaction_type") + private Optional _getUnderlyingTransactionType() { + return underlyingTransactionType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posting_date") + private Optional _getPostingDate() { + return postingDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -368,6 +461,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -410,6 +514,17 @@ public Builder underlyingTransactionRemoteId(String underlyingTransactionRemoteI return this; } + public Builder underlyingTransactionRemoteId(Nullable underlyingTransactionRemoteId) { + if (underlyingTransactionRemoteId.isNull()) { + this.underlyingTransactionRemoteId = null; + } else if (underlyingTransactionRemoteId.isEmpty()) { + this.underlyingTransactionRemoteId = Optional.empty(); + } else { + this.underlyingTransactionRemoteId = Optional.of(underlyingTransactionRemoteId.get()); + } + return this; + } + /** *

      The type of the underlying transaction.

      *
        @@ -435,6 +550,18 @@ public Builder underlyingTransactionType( return this; } + public Builder underlyingTransactionType( + Nullable underlyingTransactionType) { + if (underlyingTransactionType.isNull()) { + this.underlyingTransactionType = null; + } else if (underlyingTransactionType.isEmpty()) { + this.underlyingTransactionType = Optional.empty(); + } else { + this.underlyingTransactionType = Optional.of(underlyingTransactionType.get()); + } + return this; + } + /** *

        The accounting period that the GeneralLedgerTransaction was generated in.

        */ @@ -449,6 +576,17 @@ public Builder accountingPeriod(GeneralLedgerTransactionAccountingPeriod account return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

        The company the GeneralLedgerTransaction belongs to.

        */ @@ -463,6 +601,17 @@ public Builder company(GeneralLedgerTransactionCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        When the third party's GeneralLedgerTransaction entry was updated.

        */ @@ -477,6 +626,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

        When the third party's GeneralLedgerTransaction entry was created.

        */ @@ -491,6 +651,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -518,6 +689,17 @@ public Builder postingDate(OffsetDateTime postingDate) { return this; } + public Builder postingDate(Nullable postingDate) { + if (postingDate.isNull()) { + this.postingDate = null; + } else if (postingDate.isEmpty()) { + this.postingDate = Optional.empty(); + } else { + this.postingDate = Optional.of(postingDate.get()); + } + return this; + } + /** *

        A list of “General Ledger Transaction Applied to Lines” objects.

        */ @@ -560,6 +742,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -571,6 +764,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public GeneralLedgerTransaction build() { return new GeneralLedgerTransaction( id, 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..24ef23e3e 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionLine.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -123,8 +126,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -144,31 +150,46 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The company the GeneralLedgerTransaction belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } @@ -483,8 +504,11 @@ public Optional getProject() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("base_currency") + @JsonIgnore public Optional getBaseCurrency() { + if (baseCurrency == null) { + return Optional.empty(); + } return baseCurrency; } @@ -799,24 +823,33 @@ public Optional getBaseCurrency() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("transaction_currency") + @JsonIgnore public Optional getTransactionCurrency() { + if (transactionCurrency == null) { + return Optional.empty(); + } return transactionCurrency; } /** * @return The exchange rate between the base currency and the transaction currency. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return A description of the line item. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -835,8 +868,11 @@ public String getCreditAmount() { return creditAmount; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } @@ -858,8 +894,83 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_currency") + private Optional _getBaseCurrency() { + return baseCurrency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_currency") + private Optional _getTransactionCurrency() { + return transactionCurrency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { return fieldMappings; } @@ -965,6 +1076,8 @@ public interface _FinalStage { _FinalStage remoteId(String remoteId); + _FinalStage remoteId(Nullable remoteId); + /** *

    The datetime that this object was created by Merge.

    */ @@ -983,6 +1096,8 @@ public interface _FinalStage { _FinalStage account(GeneralLedgerTransactionLineAccount account); + _FinalStage account(Nullable account); + /** *

    The company the GeneralLedgerTransaction belongs to.

    */ @@ -990,18 +1105,26 @@ public interface _FinalStage { _FinalStage company(GeneralLedgerTransactionLineCompany company); + _FinalStage company(Nullable company); + _FinalStage employee(Optional employee); _FinalStage employee(GeneralLedgerTransactionLineEmployee employee); + _FinalStage employee(Nullable employee); + _FinalStage contact(Optional contact); _FinalStage contact(GeneralLedgerTransactionLineContact contact); + _FinalStage contact(Nullable contact); + _FinalStage project(Optional project); _FinalStage project(GeneralLedgerTransactionLineProject project); + _FinalStage project(Nullable project); + /** *

    The base currency of the transaction

    *
      @@ -1317,6 +1440,8 @@ public interface _FinalStage { _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency); + _FinalStage baseCurrency(Nullable baseCurrency); + /** *

      The transaction currency that the transaction is made in.

      *
        @@ -1632,6 +1757,8 @@ public interface _FinalStage { _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency); + _FinalStage transactionCurrency(Nullable transactionCurrency); + /** *

        The exchange rate between the base currency and the transaction currency.

        */ @@ -1639,6 +1766,8 @@ public interface _FinalStage { _FinalStage exchangeRate(String exchangeRate); + _FinalStage exchangeRate(Nullable exchangeRate); + /** *

        A description of the line item.

        */ @@ -1646,6 +1775,8 @@ public interface _FinalStage { _FinalStage description(String description); + _FinalStage description(Nullable description); + _FinalStage trackingCategories( Optional> trackingCategories); @@ -1655,6 +1786,8 @@ _FinalStage trackingCategories( _FinalStage item(GeneralLedgerTransactionLineItem item); + _FinalStage item(Nullable item); + /** *

        Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. Learn more.

        */ @@ -1665,6 +1798,8 @@ _FinalStage trackingCategories( _FinalStage fieldMappings(Optional> fieldMappings); _FinalStage fieldMappings(Map fieldMappings); + + _FinalStage fieldMappings(Nullable> fieldMappings); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -1776,6 +1911,18 @@ public _FinalStage foreignCreditAmount(@NotNull String foreignCreditAmount) { return this; } + @java.lang.Override + public _FinalStage fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @java.lang.Override public _FinalStage fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.ofNullable(fieldMappings); @@ -1809,6 +1956,18 @@ public _FinalStage remoteWasDeleted(Optional remoteWasDeleted) { return this; } + @java.lang.Override + public _FinalStage item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + @java.lang.Override public _FinalStage item(GeneralLedgerTransactionLineItem item) { this.item = Optional.ofNullable(item); @@ -1837,6 +1996,22 @@ public _FinalStage trackingCategories( return this; } + /** + *

        A description of the line item.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        A description of the line item.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -1857,6 +2032,22 @@ public _FinalStage description(Optional description) { return this; } + /** + *

        The exchange rate between the base currency and the transaction currency.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The exchange rate between the base currency and the transaction currency.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -2190,8 +2381,15 @@ public _FinalStage exchangeRate(Optional exchangeRate) { * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency) { - this.transactionCurrency = Optional.ofNullable(transactionCurrency); + public _FinalStage transactionCurrency( + Nullable transactionCurrency) { + if (transactionCurrency.isNull()) { + this.transactionCurrency = null; + } else if (transactionCurrency.isEmpty()) { + this.transactionCurrency = Optional.empty(); + } else { + this.transactionCurrency = Optional.of(transactionCurrency.get()); + } return this; } @@ -2505,17 +2703,16 @@ public _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCu *
      • ZWR - Zimbabwean Dollar (2008)
      • *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      + * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - @JsonSetter(value = "transaction_currency", nulls = Nulls.SKIP) - public _FinalStage transactionCurrency( - Optional transactionCurrency) { - this.transactionCurrency = transactionCurrency; + public _FinalStage transactionCurrency(GeneralLedgerTransactionLineTransactionCurrency transactionCurrency) { + this.transactionCurrency = Optional.ofNullable(transactionCurrency); return this; } /** - *

      The base currency of the transaction

      + *

      The transaction currency that the transaction is made in.

      *
        *
      • XUA - ADB Unit of Account
      • *
      • AFN - Afghan Afghani
      • @@ -2824,11 +3021,12 @@ public _FinalStage transactionCurrency( *
      • ZWR - Zimbabwean Dollar (2008)
      • *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      - * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { - this.baseCurrency = Optional.ofNullable(baseCurrency); + @JsonSetter(value = "transaction_currency", nulls = Nulls.SKIP) + public _FinalStage transactionCurrency( + Optional transactionCurrency) { + this.transactionCurrency = transactionCurrency; return this; } @@ -3142,123 +3340,845 @@ public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { *
    • ZWR - Zimbabwean Dollar (2008)
    • *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    - */ - @java.lang.Override - @JsonSetter(value = "base_currency", nulls = Nulls.SKIP) - public _FinalStage baseCurrency(Optional baseCurrency) { - this.baseCurrency = baseCurrency; - return this; - } - - @java.lang.Override - public _FinalStage project(GeneralLedgerTransactionLineProject project) { - this.project = Optional.ofNullable(project); - return this; - } - - @java.lang.Override - @JsonSetter(value = "project", nulls = Nulls.SKIP) - public _FinalStage project(Optional project) { - this.project = project; - return this; - } - - @java.lang.Override - public _FinalStage contact(GeneralLedgerTransactionLineContact contact) { - this.contact = Optional.ofNullable(contact); - return this; - } - - @java.lang.Override - @JsonSetter(value = "contact", nulls = Nulls.SKIP) - public _FinalStage contact(Optional contact) { - this.contact = contact; - return this; - } - - @java.lang.Override - public _FinalStage employee(GeneralLedgerTransactionLineEmployee employee) { - this.employee = Optional.ofNullable(employee); - return this; - } - - @java.lang.Override - @JsonSetter(value = "employee", nulls = Nulls.SKIP) - public _FinalStage employee(Optional employee) { - this.employee = employee; - return this; - } - - /** - *

    The company the GeneralLedgerTransaction belongs to.

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

    The company the GeneralLedgerTransaction belongs to.

    - */ - @java.lang.Override - @JsonSetter(value = "company", nulls = Nulls.SKIP) - public _FinalStage company(Optional company) { - this.company = company; - return this; - } - - @java.lang.Override - public _FinalStage account(GeneralLedgerTransactionLineAccount account) { - this.account = Optional.ofNullable(account); - return this; - } - - @java.lang.Override - @JsonSetter(value = "account", nulls = Nulls.SKIP) - public _FinalStage account(Optional account) { - this.account = account; - return this; - } - - /** - *

    The datetime that this object was modified by Merge.

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

    The datetime that this object was modified by Merge.

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

    The datetime that this object was created by Merge.

    * @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage createdAt(OffsetDateTime createdAt) { - this.createdAt = Optional.ofNullable(createdAt); + public _FinalStage baseCurrency(Nullable baseCurrency) { + if (baseCurrency.isNull()) { + this.baseCurrency = null; + } else if (baseCurrency.isEmpty()) { + this.baseCurrency = Optional.empty(); + } else { + this.baseCurrency = Optional.of(baseCurrency.get()); + } return this; } /** - *

    The datetime that this object was created by Merge.

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

    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)
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage baseCurrency(TransactionCurrencyEnum baseCurrency) { + this.baseCurrency = Optional.ofNullable(baseCurrency); + return this; + } + + /** + *

    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)
    • + *
    + */ + @java.lang.Override + @JsonSetter(value = "base_currency", nulls = Nulls.SKIP) + public _FinalStage baseCurrency(Optional baseCurrency) { + this.baseCurrency = baseCurrency; + return this; + } + + @java.lang.Override + public _FinalStage project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage project(GeneralLedgerTransactionLineProject project) { + this.project = Optional.ofNullable(project); + return this; + } + + @java.lang.Override + @JsonSetter(value = "project", nulls = Nulls.SKIP) + public _FinalStage project(Optional project) { + this.project = project; + return this; + } + + @java.lang.Override + public _FinalStage contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage contact(GeneralLedgerTransactionLineContact contact) { + this.contact = Optional.ofNullable(contact); + return this; + } + + @java.lang.Override + @JsonSetter(value = "contact", nulls = Nulls.SKIP) + public _FinalStage contact(Optional contact) { + this.contact = contact; + return this; + } + + @java.lang.Override + public _FinalStage employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage employee(GeneralLedgerTransactionLineEmployee employee) { + this.employee = Optional.ofNullable(employee); + return this; + } + + @java.lang.Override + @JsonSetter(value = "employee", nulls = Nulls.SKIP) + public _FinalStage employee(Optional employee) { + this.employee = employee; + return this; + } + + /** + *

    The company the GeneralLedgerTransaction belongs to.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + + /** + *

    The company the GeneralLedgerTransaction belongs to.

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

    The company the GeneralLedgerTransaction belongs to.

    + */ + @java.lang.Override + @JsonSetter(value = "company", nulls = Nulls.SKIP) + public _FinalStage company(Optional company) { + this.company = company; + return this; + } + + @java.lang.Override + public _FinalStage account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage account(GeneralLedgerTransactionLineAccount account) { + this.account = Optional.ofNullable(account); + return this; + } + + @java.lang.Override + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public _FinalStage account(Optional account) { + this.account = account; + return this; + } + + /** + *

    The datetime that this object was modified by Merge.

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

    The datetime that this object was modified by Merge.

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

    The datetime that this object was created by Merge.

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

    The datetime that this object was created by Merge.

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

    The third-party API ID of the matching object.

    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } return this; } 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..9245b0981 100644 --- a/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/GeneralLedgerTransactionsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -177,24 +180,51 @@ public Optional getPageSize() { /** * @return If provided, will only return objects posted after this datetime. */ - @JsonProperty("posted_date_after") + @JsonIgnore public Optional getPostedDateAfter() { + if (postedDateAfter == null) { + return Optional.empty(); + } return postedDateAfter; } /** * @return If provided, will only return objects posted before this datetime. */ - @JsonProperty("posted_date_before") + @JsonIgnore public Optional getPostedDateBefore() { + if (postedDateBefore == null) { + return Optional.empty(); + } return postedDateBefore; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posted_date_after") + private Optional _getPostedDateAfter() { + return postedDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posted_date_before") + private Optional _getPostedDateBefore() { + return postedDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -481,6 +511,17 @@ public Builder postedDateAfter(OffsetDateTime postedDateAfter) { return this; } + public Builder postedDateAfter(Nullable postedDateAfter) { + if (postedDateAfter.isNull()) { + this.postedDateAfter = null; + } else if (postedDateAfter.isEmpty()) { + this.postedDateAfter = Optional.empty(); + } else { + this.postedDateAfter = Optional.of(postedDateAfter.get()); + } + return this; + } + /** *

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

    */ @@ -495,6 +536,17 @@ public Builder postedDateBefore(OffsetDateTime postedDateBefore) { return this; } + public Builder postedDateBefore(Nullable postedDateBefore) { + if (postedDateBefore.isNull()) { + this.postedDateBefore = null; + } else if (postedDateBefore.isEmpty()) { + this.postedDateBefore = Optional.empty(); + } else { + this.postedDateBefore = Optional.of(postedDateBefore.get()); + } + return this; + } + /** *

    The API provider's ID for the given object.

    */ @@ -509,6 +561,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public GeneralLedgerTransactionsListRequest build() { return new GeneralLedgerTransactionsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatement.java b/src/main/java/com/merge/api/accounting/types/IncomeStatement.java index 46064548a..4202b2db5 100644 --- a/src/main/java/com/merge/api/accounting/types/IncomeStatement.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatement.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -114,8 +117,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -138,8 +144,11 @@ public Optional getModifiedAt() { /** * @return The income statement's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -454,32 +463,44 @@ public Optional getName() { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The company the income statement belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The income statement's start period. */ - @JsonProperty("start_period") + @JsonIgnore public Optional getStartPeriod() { + if (startPeriod == null) { + return Optional.empty(); + } return startPeriod; } /** * @return The income statement's end period. */ - @JsonProperty("end_period") + @JsonIgnore public Optional getEndPeriod() { + if (endPeriod == null) { + return Optional.empty(); + } return endPeriod; } @@ -496,8 +517,11 @@ public Optional> getCostOfSales() { /** * @return The revenue minus the cost of sale. */ - @JsonProperty("gross_profit") + @JsonIgnore public Optional getGrossProfit() { + if (grossProfit == null) { + return Optional.empty(); + } return grossProfit; } @@ -509,8 +533,11 @@ public Optional> getOperatingExpenses() { /** * @return The revenue minus the operating expenses. */ - @JsonProperty("net_operating_income") + @JsonIgnore public Optional getNetOperatingIncome() { + if (netOperatingIncome == null) { + return Optional.empty(); + } return netOperatingIncome; } @@ -522,8 +549,11 @@ public Optional> getNonOperatingExpenses() { /** * @return The gross profit minus the total expenses. */ - @JsonProperty("net_income") + @JsonIgnore public Optional getNetIncome() { + if (netIncome == null) { + return Optional.empty(); + } return netIncome; } @@ -535,13 +565,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_period") + private Optional _getStartPeriod() { + return startPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_period") + private Optional _getEndPeriod() { + return endPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gross_profit") + private Optional _getGrossProfit() { + return grossProfit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_operating_income") + private Optional _getNetOperatingIncome() { + return netOperatingIncome; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_income") + private Optional _getNetIncome() { + return netIncome; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -704,6 +806,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -746,6 +859,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The income statement's currency.

    *
      @@ -1068,6 +1192,17 @@ public Builder currency(IncomeStatementCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The company the income statement belongs to.

      */ @@ -1082,6 +1217,17 @@ public Builder company(IncomeStatementCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The income statement's start period.

      */ @@ -1096,6 +1242,17 @@ public Builder startPeriod(OffsetDateTime startPeriod) { return this; } + public Builder startPeriod(Nullable startPeriod) { + if (startPeriod.isNull()) { + this.startPeriod = null; + } else if (startPeriod.isEmpty()) { + this.startPeriod = Optional.empty(); + } else { + this.startPeriod = Optional.of(startPeriod.get()); + } + return this; + } + /** *

      The income statement's end period.

      */ @@ -1110,6 +1267,17 @@ public Builder endPeriod(OffsetDateTime endPeriod) { return this; } + public Builder endPeriod(Nullable endPeriod) { + if (endPeriod.isNull()) { + this.endPeriod = null; + } else if (endPeriod.isEmpty()) { + this.endPeriod = Optional.empty(); + } else { + this.endPeriod = Optional.of(endPeriod.get()); + } + return this; + } + @JsonSetter(value = "income", nulls = Nulls.SKIP) public Builder income(Optional> income) { this.income = income; @@ -1146,6 +1314,17 @@ public Builder grossProfit(Double grossProfit) { return this; } + public Builder grossProfit(Nullable grossProfit) { + if (grossProfit.isNull()) { + this.grossProfit = null; + } else if (grossProfit.isEmpty()) { + this.grossProfit = Optional.empty(); + } else { + this.grossProfit = Optional.of(grossProfit.get()); + } + return this; + } + @JsonSetter(value = "operating_expenses", nulls = Nulls.SKIP) public Builder operatingExpenses(Optional> operatingExpenses) { this.operatingExpenses = operatingExpenses; @@ -1171,6 +1350,17 @@ public Builder netOperatingIncome(Double netOperatingIncome) { return this; } + public Builder netOperatingIncome(Nullable netOperatingIncome) { + if (netOperatingIncome.isNull()) { + this.netOperatingIncome = null; + } else if (netOperatingIncome.isEmpty()) { + this.netOperatingIncome = Optional.empty(); + } else { + this.netOperatingIncome = Optional.of(netOperatingIncome.get()); + } + return this; + } + @JsonSetter(value = "non_operating_expenses", nulls = Nulls.SKIP) public Builder nonOperatingExpenses(Optional> nonOperatingExpenses) { this.nonOperatingExpenses = nonOperatingExpenses; @@ -1196,6 +1386,17 @@ public Builder netIncome(Double netIncome) { return this; } + public Builder netIncome(Nullable netIncome) { + if (netIncome.isNull()) { + this.netIncome = null; + } else if (netIncome.isEmpty()) { + this.netIncome = Optional.empty(); + } else { + this.netIncome = Optional.of(netIncome.get()); + } + 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.

      */ @@ -1221,6 +1422,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1232,6 +1444,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public IncomeStatement build() { return new IncomeStatement( id, 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..7c261a57d 100644 --- a/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = IncomeStatementsListRequest.Builder.class) public final class IncomeStatementsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional companyId; @@ -50,7 +53,7 @@ public final class IncomeStatementsListRequest { private final Map additionalProperties; private IncomeStatementsListRequest( - Optional> expand, + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, @@ -82,7 +85,7 @@ private IncomeStatementsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 companyId = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(IncomeStatementsListRequest 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(IncomeStatementsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public IncomeStatementsListRequest build() { return new IncomeStatementsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequestExpandItem.java new file mode 100644 index 000000000..f415ce77c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 IncomeStatementsListRequestExpandItem { + public static final IncomeStatementsListRequestExpandItem COMPANY = + new IncomeStatementsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + IncomeStatementsListRequestExpandItem(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 IncomeStatementsListRequestExpandItem + && this.string.equals(((IncomeStatementsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IncomeStatementsListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new IncomeStatementsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java index 497bc4788..a27327bda 100644 --- a/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = IncomeStatementsRetrieveRequest.Builder.class) public final class IncomeStatementsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class IncomeStatementsRetrieveRequest { private final Map additionalProperties; private IncomeStatementsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private IncomeStatementsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(IncomeStatementsRetrieveRequest 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(IncomeStatementsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..fc5c2e379 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IncomeStatementsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 IncomeStatementsRetrieveRequestExpandItem { + public static final IncomeStatementsRetrieveRequestExpandItem COMPANY = + new IncomeStatementsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + IncomeStatementsRetrieveRequestExpandItem(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 IncomeStatementsRetrieveRequestExpandItem + && this.string.equals(((IncomeStatementsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static IncomeStatementsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new IncomeStatementsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} 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..6258a24b3 100644 --- a/src/main/java/com/merge/api/accounting/types/Invoice.java +++ b/src/main/java/com/merge/api/accounting/types/Invoice.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -182,8 +185,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -210,72 +216,99 @@ public Optional getModifiedAt() { *
    • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return The invoice's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The invoice's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The invoice's issue date. */ - @JsonProperty("issue_date") + @JsonIgnore public Optional getIssueDate() { + if (issueDate == null) { + return Optional.empty(); + } return issueDate; } /** * @return The invoice's due date. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } /** * @return The invoice's paid date. */ - @JsonProperty("paid_on_date") + @JsonIgnore public Optional getPaidOnDate() { + if (paidOnDate == null) { + return Optional.empty(); + } return paidOnDate; } /** * @return The invoice's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The company the invoice belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } @@ -590,40 +623,55 @@ public Optional getEmployee() { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The invoice's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The payment term that applies to this transaction. */ - @JsonProperty("payment_term") + @JsonIgnore public Optional getPaymentTerm() { + if (paymentTerm == null) { + return Optional.empty(); + } return paymentTerm; } /** * @return The total discounts applied to the total cost. */ - @JsonProperty("total_discount") + @JsonIgnore public Optional getTotalDiscount() { + if (totalDiscount == null) { + return Optional.empty(); + } return totalDiscount; } /** * @return The total amount being paid before taxes. */ - @JsonProperty("sub_total") + @JsonIgnore public Optional getSubTotal() { + if (subTotal == null) { + return Optional.empty(); + } return subTotal; } @@ -638,40 +686,55 @@ public Optional getSubTotal() { *
  • VOID - VOID
  • * */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The total amount being paid in taxes. */ - @JsonProperty("total_tax_amount") + @JsonIgnore public Optional getTotalTaxAmount() { + if (totalTaxAmount == null) { + return Optional.empty(); + } return totalTaxAmount; } /** * @return The invoice's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The invoice's remaining balance. */ - @JsonProperty("balance") + @JsonIgnore public Optional getBalance() { + if (balance == null) { + return Optional.empty(); + } return balance; } /** * @return When the third party's invoice entry was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -683,8 +746,11 @@ public Optional>> getTrackingCatego /** * @return The accounting period that the Invoice was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -733,8 +799,11 @@ public Optional> getAppliedVendorCredits() /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -746,13 +815,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -761,6 +836,150 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date") + private Optional _getIssueDate() { + return issueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("paid_on_date") + private Optional _getPaidOnDate() { + return paidOnDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_term") + private Optional _getPaymentTerm() { + return paymentTerm; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_discount") + private Optional _getTotalDiscount() { + return totalDiscount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sub_total") + private Optional _getSubTotal() { + return subTotal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_tax_amount") + private Optional _getTotalTaxAmount() { + return totalTaxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("balance") + private Optional _getBalance() { + return balance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -1005,6 +1224,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -1051,6 +1281,17 @@ public Builder type(InvoiceTypeEnum type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

    The invoice's contact.

    */ @@ -1065,6 +1306,17 @@ public Builder contact(InvoiceContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

    The invoice's number.

    */ @@ -1079,6 +1331,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

    The invoice's issue date.

    */ @@ -1093,6 +1356,17 @@ public Builder issueDate(OffsetDateTime issueDate) { return this; } + public Builder issueDate(Nullable issueDate) { + if (issueDate.isNull()) { + this.issueDate = null; + } else if (issueDate.isEmpty()) { + this.issueDate = Optional.empty(); + } else { + this.issueDate = Optional.of(issueDate.get()); + } + return this; + } + /** *

    The invoice's due date.

    */ @@ -1107,6 +1381,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

    The invoice's paid date.

    */ @@ -1121,6 +1406,17 @@ public Builder paidOnDate(OffsetDateTime paidOnDate) { return this; } + public Builder paidOnDate(Nullable paidOnDate) { + if (paidOnDate.isNull()) { + this.paidOnDate = null; + } else if (paidOnDate.isEmpty()) { + this.paidOnDate = Optional.empty(); + } else { + this.paidOnDate = Optional.of(paidOnDate.get()); + } + return this; + } + /** *

    The invoice's private note.

    */ @@ -1135,6 +1431,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The company the invoice belongs to.

    */ @@ -1149,6 +1456,17 @@ public Builder company(InvoiceCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The employee this overall transaction relates to.

    */ @@ -1163,6 +1481,17 @@ public Builder employee(InvoiceEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The invoice's currency.

    *
      @@ -1485,6 +1814,17 @@ public Builder currency(InvoiceCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The invoice's exchange rate.

      */ @@ -1499,6 +1839,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The payment term that applies to this transaction.

      */ @@ -1513,6 +1864,17 @@ public Builder paymentTerm(InvoicePaymentTerm paymentTerm) { return this; } + public Builder paymentTerm(Nullable paymentTerm) { + if (paymentTerm.isNull()) { + this.paymentTerm = null; + } else if (paymentTerm.isEmpty()) { + this.paymentTerm = Optional.empty(); + } else { + this.paymentTerm = Optional.of(paymentTerm.get()); + } + return this; + } + /** *

      The total discounts applied to the total cost.

      */ @@ -1527,6 +1889,17 @@ public Builder totalDiscount(Double totalDiscount) { return this; } + public Builder totalDiscount(Nullable totalDiscount) { + if (totalDiscount.isNull()) { + this.totalDiscount = null; + } else if (totalDiscount.isEmpty()) { + this.totalDiscount = Optional.empty(); + } else { + this.totalDiscount = Optional.of(totalDiscount.get()); + } + return this; + } + /** *

      The total amount being paid before taxes.

      */ @@ -1541,6 +1914,17 @@ public Builder subTotal(Double subTotal) { return this; } + public Builder subTotal(Nullable subTotal) { + if (subTotal.isNull()) { + this.subTotal = null; + } else if (subTotal.isEmpty()) { + this.subTotal = Optional.empty(); + } else { + this.subTotal = Optional.of(subTotal.get()); + } + return this; + } + /** *

      The status of the invoice.

      *
        @@ -1563,6 +1947,17 @@ public Builder status(InvoiceStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

        The total amount being paid in taxes.

        */ @@ -1577,6 +1972,17 @@ public Builder totalTaxAmount(Double totalTaxAmount) { return this; } + public Builder totalTaxAmount(Nullable totalTaxAmount) { + if (totalTaxAmount.isNull()) { + this.totalTaxAmount = null; + } else if (totalTaxAmount.isEmpty()) { + this.totalTaxAmount = Optional.empty(); + } else { + this.totalTaxAmount = Optional.of(totalTaxAmount.get()); + } + return this; + } + /** *

        The invoice's total amount.

        */ @@ -1591,6 +1997,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

        The invoice's remaining balance.

        */ @@ -1605,6 +2022,17 @@ public Builder balance(Double balance) { return this; } + public Builder balance(Nullable balance) { + if (balance.isNull()) { + this.balance = null; + } else if (balance.isEmpty()) { + this.balance = Optional.empty(); + } else { + this.balance = Optional.of(balance.get()); + } + return this; + } + /** *

        When the third party's invoice entry was updated.

        */ @@ -1619,6 +2047,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories(Optional>> trackingCategories) { this.trackingCategories = trackingCategories; @@ -1644,6 +2083,17 @@ public Builder accountingPeriod(InvoiceAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "purchase_orders", nulls = Nulls.SKIP) public Builder purchaseOrders(Optional>> purchaseOrders) { this.purchaseOrders = purchaseOrders; @@ -1736,6 +2186,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + 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.

        */ @@ -1761,6 +2222,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1772,6 +2244,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..bd99450b8 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItem.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -126,8 +129,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -150,53 +156,74 @@ public Optional getModifiedAt() { /** * @return The line item's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } /** * @return The line item's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } /** * @return The invoice's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } @@ -511,39 +538,57 @@ public Optional getContact() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -558,8 +603,11 @@ public Optional>> getTracki /** * @return The company the invoice belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -571,8 +619,11 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } @@ -581,6 +632,102 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -755,6 +902,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -797,6 +955,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

      The line item's unit price.

      */ @@ -811,6 +980,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

      The line item's quantity.

      */ @@ -825,6 +1005,17 @@ public Builder quantity(Double quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + /** *

      The line item's total amount.

      */ @@ -839,6 +1030,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The employee this overall transaction relates to.

      */ @@ -853,6 +1055,17 @@ public Builder employee(InvoiceLineItemEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -864,6 +1077,17 @@ public Builder project(InvoiceLineItemProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + /** *

      The invoice's contact.

      */ @@ -878,6 +1102,17 @@ public Builder contact(InvoiceLineItemContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The line item's currency.

      *
        @@ -1200,6 +1435,17 @@ public Builder currency(InvoiceLineItemCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The line item's exchange rate.

        */ @@ -1214,6 +1460,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -1225,6 +1482,17 @@ public Builder item(InvoiceLineItemItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + @JsonSetter(value = "account", nulls = Nulls.SKIP) public Builder account(Optional account) { this.account = account; @@ -1236,6 +1504,17 @@ public Builder account(InvoiceLineItemAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -1250,6 +1529,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -1261,6 +1551,17 @@ public Builder trackingCategory(InvoiceLineItemTrackingCategory trackingCategory return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The invoice line item's associated tracking categories.

        */ @@ -1290,6 +1591,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

        */ @@ -1315,6 +1627,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..6c25d9ac8 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceLineItemRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -108,61 +111,85 @@ private InvoiceLineItemRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return The line item's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } /** * @return The line item's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } /** * @return The invoice's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } @@ -477,39 +504,57 @@ public Optional getContact() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -524,18 +569,27 @@ public Optional>> ge /** * @return The company the invoice belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -544,6 +598,108 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -693,6 +849,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The line item's description.

      */ @@ -707,6 +874,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

      The line item's unit price.

      */ @@ -721,6 +899,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

      The line item's quantity.

      */ @@ -735,6 +924,17 @@ public Builder quantity(Double quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + /** *

      The line item's total amount.

      */ @@ -749,6 +949,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The employee this overall transaction relates to.

      */ @@ -763,6 +974,17 @@ public Builder employee(InvoiceLineItemRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -774,6 +996,17 @@ public Builder project(InvoiceLineItemRequestProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + /** *

      The invoice's contact.

      */ @@ -788,6 +1021,17 @@ public Builder contact(InvoiceLineItemRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The line item's currency.

      *
        @@ -1110,6 +1354,17 @@ public Builder currency(InvoiceLineItemRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The line item's exchange rate.

        */ @@ -1124,6 +1379,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -1135,6 +1401,17 @@ public Builder item(InvoiceLineItemRequestItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + @JsonSetter(value = "account", nulls = Nulls.SKIP) public Builder account(Optional account) { this.account = account; @@ -1146,6 +1423,17 @@ public Builder account(InvoiceLineItemRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -1160,6 +1448,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -1171,6 +1470,17 @@ public Builder trackingCategory(InvoiceLineItemRequestTrackingCategory trackingC return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The invoice line item's associated tracking categories.

        */ @@ -1201,6 +1511,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1212,6 +1533,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1223,6 +1555,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..4259442ee 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoiceRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -141,64 +144,88 @@ private InvoiceRequest( *
      • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
      • *
      */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return The invoice's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The invoice's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The invoice's issue date. */ - @JsonProperty("issue_date") + @JsonIgnore public Optional getIssueDate() { + if (issueDate == null) { + return Optional.empty(); + } return issueDate; } /** * @return The invoice's due date. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } /** * @return The invoice's paid date. */ - @JsonProperty("paid_on_date") + @JsonIgnore public Optional getPaidOnDate() { + if (paidOnDate == null) { + return Optional.empty(); + } return paidOnDate; } /** * @return The employee this overall transaction relates to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The invoice's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } @@ -213,16 +240,22 @@ public Optional getMemo() { *
    • VOID - VOID
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The company the invoice belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -537,72 +570,99 @@ public Optional getCompany() { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The invoice's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The total discounts applied to the total cost. */ - @JsonProperty("total_discount") + @JsonIgnore public Optional getTotalDiscount() { + if (totalDiscount == null) { + return Optional.empty(); + } return totalDiscount; } /** * @return The total amount being paid before taxes. */ - @JsonProperty("sub_total") + @JsonIgnore public Optional getSubTotal() { + if (subTotal == null) { + return Optional.empty(); + } return subTotal; } /** * @return The payment term that applies to this transaction. */ - @JsonProperty("payment_term") + @JsonIgnore public Optional getPaymentTerm() { + if (paymentTerm == null) { + return Optional.empty(); + } return paymentTerm; } /** * @return The total amount being paid in taxes. */ - @JsonProperty("total_tax_amount") + @JsonIgnore public Optional getTotalTaxAmount() { + if (totalTaxAmount == null) { + return Optional.empty(); + } return totalTaxAmount; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The invoice's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The invoice's remaining balance. */ - @JsonProperty("balance") + @JsonIgnore public Optional getBalance() { + if (balance == null) { + return Optional.empty(); + } return balance; } @@ -629,13 +689,19 @@ public Optional>> getPurchaseOrd return purchaseOrders; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -644,6 +710,132 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date") + private Optional _getIssueDate() { + return issueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("paid_on_date") + private Optional _getPaidOnDate() { + return paidOnDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_discount") + private Optional _getTotalDiscount() { + return totalDiscount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sub_total") + private Optional _getSubTotal() { + return subTotal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_term") + private Optional _getPaymentTerm() { + return paymentTerm; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_tax_amount") + private Optional _getTotalTaxAmount() { + return totalTaxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("balance") + private Optional _getBalance() { + return balance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -831,6 +1023,17 @@ public Builder type(InvoiceRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

    The invoice's contact.

    */ @@ -845,6 +1048,17 @@ public Builder contact(InvoiceRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

    The invoice's number.

    */ @@ -859,6 +1073,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

    The invoice's issue date.

    */ @@ -873,6 +1098,17 @@ public Builder issueDate(OffsetDateTime issueDate) { return this; } + public Builder issueDate(Nullable issueDate) { + if (issueDate.isNull()) { + this.issueDate = null; + } else if (issueDate.isEmpty()) { + this.issueDate = Optional.empty(); + } else { + this.issueDate = Optional.of(issueDate.get()); + } + return this; + } + /** *

    The invoice's due date.

    */ @@ -887,6 +1123,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

    The invoice's paid date.

    */ @@ -901,6 +1148,17 @@ public Builder paidOnDate(OffsetDateTime paidOnDate) { return this; } + public Builder paidOnDate(Nullable paidOnDate) { + if (paidOnDate.isNull()) { + this.paidOnDate = null; + } else if (paidOnDate.isEmpty()) { + this.paidOnDate = Optional.empty(); + } else { + this.paidOnDate = Optional.of(paidOnDate.get()); + } + return this; + } + /** *

    The employee this overall transaction relates to.

    */ @@ -915,6 +1173,17 @@ public Builder employee(InvoiceRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The invoice's private note.

    */ @@ -929,6 +1198,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The status of the invoice.

    *
      @@ -951,6 +1231,17 @@ public Builder status(InvoiceRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The company the invoice belongs to.

      */ @@ -965,6 +1256,17 @@ public Builder company(InvoiceRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The invoice's currency.

      *
        @@ -1287,6 +1589,17 @@ public Builder currency(InvoiceRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The invoice's exchange rate.

        */ @@ -1301,6 +1614,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The total discounts applied to the total cost.

        */ @@ -1315,6 +1639,17 @@ public Builder totalDiscount(Double totalDiscount) { return this; } + public Builder totalDiscount(Nullable totalDiscount) { + if (totalDiscount.isNull()) { + this.totalDiscount = null; + } else if (totalDiscount.isEmpty()) { + this.totalDiscount = Optional.empty(); + } else { + this.totalDiscount = Optional.of(totalDiscount.get()); + } + return this; + } + /** *

        The total amount being paid before taxes.

        */ @@ -1329,6 +1664,17 @@ public Builder subTotal(Double subTotal) { return this; } + public Builder subTotal(Nullable subTotal) { + if (subTotal.isNull()) { + this.subTotal = null; + } else if (subTotal.isEmpty()) { + this.subTotal = Optional.empty(); + } else { + this.subTotal = Optional.of(subTotal.get()); + } + return this; + } + /** *

        The payment term that applies to this transaction.

        */ @@ -1343,6 +1689,17 @@ public Builder paymentTerm(InvoiceRequestPaymentTerm paymentTerm) { return this; } + public Builder paymentTerm(Nullable paymentTerm) { + if (paymentTerm.isNull()) { + this.paymentTerm = null; + } else if (paymentTerm.isEmpty()) { + this.paymentTerm = Optional.empty(); + } else { + this.paymentTerm = Optional.of(paymentTerm.get()); + } + return this; + } + /** *

        The total amount being paid in taxes.

        */ @@ -1357,6 +1714,17 @@ public Builder totalTaxAmount(Double totalTaxAmount) { return this; } + public Builder totalTaxAmount(Nullable totalTaxAmount) { + if (totalTaxAmount.isNull()) { + this.totalTaxAmount = null; + } else if (totalTaxAmount.isEmpty()) { + this.totalTaxAmount = Optional.empty(); + } else { + this.totalTaxAmount = Optional.of(totalTaxAmount.get()); + } + return this; + } + /** *

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

        */ @@ -1371,6 +1739,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

        The invoice's total amount.

        */ @@ -1385,6 +1764,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

        The invoice's remaining balance.

        */ @@ -1399,6 +1789,17 @@ public Builder balance(Double balance) { return this; } + public Builder balance(Nullable balance) { + if (balance.isNull()) { + this.balance = null; + } else if (balance.isEmpty()) { + this.balance = Optional.empty(); + } else { + this.balance = Optional.of(balance.get()); + } + return this; + } + /** *

        Array of Payment object IDs.

        */ @@ -1458,6 +1859,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1469,6 +1881,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..3367e2141 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesLineItemsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..d158c67b7 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -55,11 +58,11 @@ public final class InvoicesListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional status; @@ -84,9 +87,9 @@ private InvoicesListRequest( Optional modifiedBefore, Optional number, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional status, Optional type, Map additionalProperties) { @@ -197,16 +200,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("issue_date_after") + @JsonIgnore public Optional getIssueDateAfter() { + if (issueDateAfter == null) { + return Optional.empty(); + } return issueDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("issue_date_before") + @JsonIgnore public Optional getIssueDateBefore() { + if (issueDateBefore == null) { + return Optional.empty(); + } return issueDateBefore; } @@ -229,8 +238,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return Invoices with this number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } @@ -246,15 +258,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -262,7 +277,7 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -277,8 +292,11 @@ public Optional getShowEnumOrigins() { *
      • VOID - VOID
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -289,8 +307,47 @@ public Optional getStatus() { *
    • ACCOUNTS_PAYABLE - ACCOUNTS_PAYABLE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date_after") + private Optional _getIssueDateAfter() { + return issueDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date_before") + private Optional _getIssueDateBefore() { + return issueDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { return type; } @@ -398,11 +455,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional status = Optional.empty(); @@ -597,6 +654,17 @@ public Builder issueDateAfter(OffsetDateTime issueDateAfter) { return this; } + public Builder issueDateAfter(Nullable issueDateAfter) { + if (issueDateAfter.isNull()) { + this.issueDateAfter = null; + } else if (issueDateAfter.isEmpty()) { + this.issueDateAfter = Optional.empty(); + } else { + this.issueDateAfter = Optional.of(issueDateAfter.get()); + } + return this; + } + /** *

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

    */ @@ -611,6 +679,17 @@ public Builder issueDateBefore(OffsetDateTime issueDateBefore) { return this; } + public Builder issueDateBefore(Nullable issueDateBefore) { + if (issueDateBefore.isNull()) { + this.issueDateBefore = null; + } else if (issueDateBefore.isEmpty()) { + this.issueDateBefore = Optional.empty(); + } else { + this.issueDateBefore = Optional.of(issueDateBefore.get()); + } + return this; + } + /** *

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

    */ @@ -653,6 +732,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

    Number of results to return per page.

    */ @@ -671,12 +761,12 @@ public Builder pageSize(Integer pageSize) { *

    Deprecated. Use show_enum_origins.

    */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(InvoicesListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -695,16 +785,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(InvoicesListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } @@ -731,6 +832,17 @@ public Builder status(InvoicesListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

    If provided, will only return Invoices with this type.

    *
      @@ -749,6 +861,17 @@ public Builder type(InvoicesListRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + public InvoicesListRequest build() { return new InvoicesListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestRemoteFields.java new file mode 100644 index 000000000..2e1f40ccc --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestRemoteFields.java @@ -0,0 +1,74 @@ +/** + * 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 InvoicesListRequestRemoteFields { + public static final InvoicesListRequestRemoteFields TYPE = new InvoicesListRequestRemoteFields(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + InvoicesListRequestRemoteFields(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 InvoicesListRequestRemoteFields + && this.string.equals(((InvoicesListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InvoicesListRequestRemoteFields valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new InvoicesListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..754bb3476 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 InvoicesListRequestShowEnumOrigins { + public static final InvoicesListRequestShowEnumOrigins TYPE = + new InvoicesListRequestShowEnumOrigins(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + InvoicesListRequestShowEnumOrigins(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 InvoicesListRequestShowEnumOrigins + && this.string.equals(((InvoicesListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InvoicesListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new InvoicesListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..807dc3bf2 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = InvoicesMetaPatchRetrieveRequest.Builder.class) +public final class InvoicesMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private InvoicesMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InvoicesMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(InvoicesMetaPatchRetrieveRequest other) { + return this; + } + + public InvoicesMetaPatchRetrieveRequest build() { + return new InvoicesMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..09342c812 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java index b79fb3f20..b674b9c1d 100644 --- a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequest.java @@ -30,9 +30,9 @@ public final class InvoicesRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -41,8 +41,8 @@ private InvoicesRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -89,7 +89,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -97,7 +97,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -151,9 +151,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -235,12 +235,12 @@ public Builder includeShellData(Boolean includeShellData) { *

      Deprecated. Use show_enum_origins.

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

      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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(InvoicesRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..f84f3974d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 InvoicesRetrieveRequestRemoteFields { + public static final InvoicesRetrieveRequestRemoteFields TYPE = + new InvoicesRetrieveRequestRemoteFields(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + InvoicesRetrieveRequestRemoteFields(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 InvoicesRetrieveRequestRemoteFields + && this.string.equals(((InvoicesRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InvoicesRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new InvoicesRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..22c29ba5d --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/InvoicesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 InvoicesRetrieveRequestShowEnumOrigins { + public static final InvoicesRetrieveRequestShowEnumOrigins TYPE = + new InvoicesRetrieveRequestShowEnumOrigins(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + InvoicesRetrieveRequestShowEnumOrigins(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 InvoicesRetrieveRequestShowEnumOrigins + && this.string.equals(((InvoicesRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InvoicesRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new InvoicesRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/Issue.java b/src/main/java/com/merge/api/accounting/types/Issue.java index f307b7d67..30928360a 100644 --- a/src/main/java/com/merge/api/accounting/types/Issue.java +++ b/src/main/java/com/merge/api/accounting/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..eb350da40 100644 --- a/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

      If provided, will only return issues whose first incident time was before this datetime.

      */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

      If true, will include muted issues

      */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

      If provided, will only return issues whose last incident time was before this datetime.

      */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

      If provided, will only include issues pertaining to the linked account passed in.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..db0ac6f80 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} 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..77388dc96 100644 --- a/src/main/java/com/merge/api/accounting/types/Item.java +++ b/src/main/java/com/merge/api/accounting/types/Item.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -110,8 +113,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,8 +140,11 @@ public Optional getModifiedAt() { /** * @return The item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -146,8 +155,11 @@ public Optional getName() { *
    • ARCHIVED - ARCHIVED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -160,72 +172,99 @@ public Optional getStatus() { *
  • UNKNOWN - UNKNOWN
  • * */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return The item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The price at which the item is purchased from a vendor. */ - @JsonProperty("purchase_price") + @JsonIgnore public Optional getPurchasePrice() { + if (purchasePrice == null) { + return Optional.empty(); + } return purchasePrice; } /** * @return References the default account used to record a purchase of the item. */ - @JsonProperty("purchase_account") + @JsonIgnore public Optional getPurchaseAccount() { + if (purchaseAccount == null) { + return Optional.empty(); + } return purchaseAccount; } /** * @return References the default account used to record a sale. */ - @JsonProperty("sales_account") + @JsonIgnore public Optional getSalesAccount() { + if (salesAccount == null) { + return Optional.empty(); + } return salesAccount; } /** * @return The company the item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The default purchase tax rate for this item. */ - @JsonProperty("purchase_tax_rate") + @JsonIgnore public Optional getPurchaseTaxRate() { + if (purchaseTaxRate == null) { + return Optional.empty(); + } return purchaseTaxRate; } /** * @return The default sales tax rate for this item. */ - @JsonProperty("sales_tax_rate") + @JsonIgnore public Optional getSalesTaxRate() { + if (salesTaxRate == null) { + return Optional.empty(); + } return salesTaxRate; } /** * @return When the third party's item note was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -237,13 +276,103 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_price") + private Optional _getPurchasePrice() { + return purchasePrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_account") + private Optional _getPurchaseAccount() { + return purchaseAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_account") + private Optional _getSalesAccount() { + return salesAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_tax_rate") + private Optional _getPurchaseTaxRate() { + return purchaseTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_tax_rate") + private Optional _getSalesTaxRate() { + return salesTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -401,6 +530,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -443,6 +583,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The item's status.

    *
      @@ -461,6 +612,17 @@ public Builder status(ItemStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The item's type.

      *
        @@ -481,6 +643,17 @@ public Builder type(ItemType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

        The item's unit price.

        */ @@ -495,6 +668,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

        The price at which the item is purchased from a vendor.

        */ @@ -509,6 +693,17 @@ public Builder purchasePrice(Double purchasePrice) { return this; } + public Builder purchasePrice(Nullable purchasePrice) { + if (purchasePrice.isNull()) { + this.purchasePrice = null; + } else if (purchasePrice.isEmpty()) { + this.purchasePrice = Optional.empty(); + } else { + this.purchasePrice = Optional.of(purchasePrice.get()); + } + return this; + } + /** *

        References the default account used to record a purchase of the item.

        */ @@ -523,6 +718,17 @@ public Builder purchaseAccount(ItemPurchaseAccount purchaseAccount) { return this; } + public Builder purchaseAccount(Nullable purchaseAccount) { + if (purchaseAccount.isNull()) { + this.purchaseAccount = null; + } else if (purchaseAccount.isEmpty()) { + this.purchaseAccount = Optional.empty(); + } else { + this.purchaseAccount = Optional.of(purchaseAccount.get()); + } + return this; + } + /** *

        References the default account used to record a sale.

        */ @@ -537,6 +743,17 @@ public Builder salesAccount(ItemSalesAccount salesAccount) { return this; } + public Builder salesAccount(Nullable salesAccount) { + if (salesAccount.isNull()) { + this.salesAccount = null; + } else if (salesAccount.isEmpty()) { + this.salesAccount = Optional.empty(); + } else { + this.salesAccount = Optional.of(salesAccount.get()); + } + return this; + } + /** *

        The company the item belongs to.

        */ @@ -551,6 +768,17 @@ public Builder company(ItemCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The default purchase tax rate for this item.

        */ @@ -565,6 +793,17 @@ public Builder purchaseTaxRate(ItemPurchaseTaxRate purchaseTaxRate) { return this; } + public Builder purchaseTaxRate(Nullable purchaseTaxRate) { + if (purchaseTaxRate.isNull()) { + this.purchaseTaxRate = null; + } else if (purchaseTaxRate.isEmpty()) { + this.purchaseTaxRate = Optional.empty(); + } else { + this.purchaseTaxRate = Optional.of(purchaseTaxRate.get()); + } + return this; + } + /** *

        The default sales tax rate for this item.

        */ @@ -579,6 +818,17 @@ public Builder salesTaxRate(ItemSalesTaxRate salesTaxRate) { return this; } + public Builder salesTaxRate(Nullable salesTaxRate) { + if (salesTaxRate.isNull()) { + this.salesTaxRate = null; + } else if (salesTaxRate.isEmpty()) { + this.salesTaxRate = Optional.empty(); + } else { + this.salesTaxRate = Optional.of(salesTaxRate.get()); + } + return this; + } + /** *

        When the third party's item note was updated.

        */ @@ -593,6 +843,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

        */ @@ -618,6 +879,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -629,6 +901,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Item build() { return new Item( id, diff --git a/src/main/java/com/merge/api/accounting/types/ItemRequestRequest.java b/src/main/java/com/merge/api/accounting/types/ItemRequestRequest.java index 1ff085658..3ec23183b 100644 --- a/src/main/java/com/merge/api/accounting/types/ItemRequestRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ItemRequestRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -79,8 +82,11 @@ private ItemRequestRequest( /** * @return The item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -91,8 +97,11 @@ public Optional getName() { *
      • ARCHIVED - ARCHIVED
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -105,74 +114,176 @@ public Optional getStatus() { *
    • UNKNOWN - UNKNOWN
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return The item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The price at which the item is purchased from a vendor. */ - @JsonProperty("purchase_price") + @JsonIgnore public Optional getPurchasePrice() { + if (purchasePrice == null) { + return Optional.empty(); + } return purchasePrice; } /** * @return References the default account used to record a purchase of the item. */ - @JsonProperty("purchase_account") + @JsonIgnore public Optional getPurchaseAccount() { + if (purchaseAccount == null) { + return Optional.empty(); + } return purchaseAccount; } /** * @return References the default account used to record a sale. */ - @JsonProperty("sales_account") + @JsonIgnore public Optional getSalesAccount() { + if (salesAccount == null) { + return Optional.empty(); + } return salesAccount; } /** * @return The company the item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The default purchase tax rate for this item. */ - @JsonProperty("purchase_tax_rate") + @JsonIgnore public Optional getPurchaseTaxRate() { + if (purchaseTaxRate == null) { + return Optional.empty(); + } return purchaseTaxRate; } /** * @return The default sales tax rate for this item. */ - @JsonProperty("sales_tax_rate") + @JsonIgnore public Optional getSalesTaxRate() { + if (salesTaxRate == null) { + return Optional.empty(); + } return salesTaxRate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_price") + private Optional _getPurchasePrice() { + return purchasePrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_account") + private Optional _getPurchaseAccount() { + return purchaseAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_account") + private Optional _getSalesAccount() { + return salesAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_tax_rate") + private Optional _getPurchaseTaxRate() { + return purchaseTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_tax_rate") + private Optional _getSalesTaxRate() { + return salesTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -289,6 +400,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The item's status.

    *
      @@ -307,6 +429,17 @@ public Builder status(ItemRequestRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The item's type.

      *
        @@ -327,6 +460,17 @@ public Builder type(ItemRequestRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

        The item's unit price.

        */ @@ -341,6 +485,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

        The price at which the item is purchased from a vendor.

        */ @@ -355,6 +510,17 @@ public Builder purchasePrice(Double purchasePrice) { return this; } + public Builder purchasePrice(Nullable purchasePrice) { + if (purchasePrice.isNull()) { + this.purchasePrice = null; + } else if (purchasePrice.isEmpty()) { + this.purchasePrice = Optional.empty(); + } else { + this.purchasePrice = Optional.of(purchasePrice.get()); + } + return this; + } + /** *

        References the default account used to record a purchase of the item.

        */ @@ -369,6 +535,17 @@ public Builder purchaseAccount(ItemRequestRequestPurchaseAccount purchaseAccount return this; } + public Builder purchaseAccount(Nullable purchaseAccount) { + if (purchaseAccount.isNull()) { + this.purchaseAccount = null; + } else if (purchaseAccount.isEmpty()) { + this.purchaseAccount = Optional.empty(); + } else { + this.purchaseAccount = Optional.of(purchaseAccount.get()); + } + return this; + } + /** *

        References the default account used to record a sale.

        */ @@ -383,6 +560,17 @@ public Builder salesAccount(ItemRequestRequestSalesAccount salesAccount) { return this; } + public Builder salesAccount(Nullable salesAccount) { + if (salesAccount.isNull()) { + this.salesAccount = null; + } else if (salesAccount.isEmpty()) { + this.salesAccount = Optional.empty(); + } else { + this.salesAccount = Optional.of(salesAccount.get()); + } + return this; + } + /** *

        The company the item belongs to.

        */ @@ -397,6 +585,17 @@ public Builder company(ItemRequestRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The default purchase tax rate for this item.

        */ @@ -411,6 +610,17 @@ public Builder purchaseTaxRate(ItemRequestRequestPurchaseTaxRate purchaseTaxRate return this; } + public Builder purchaseTaxRate(Nullable purchaseTaxRate) { + if (purchaseTaxRate.isNull()) { + this.purchaseTaxRate = null; + } else if (purchaseTaxRate.isEmpty()) { + this.purchaseTaxRate = Optional.empty(); + } else { + this.purchaseTaxRate = Optional.of(purchaseTaxRate.get()); + } + return this; + } + /** *

        The default sales tax rate for this item.

        */ @@ -425,6 +635,17 @@ public Builder salesTaxRate(ItemRequestRequestSalesTaxRate salesTaxRate) { return this; } + public Builder salesTaxRate(Nullable salesTaxRate) { + if (salesTaxRate.isNull()) { + this.salesTaxRate = null; + } else if (salesTaxRate.isEmpty()) { + this.salesTaxRate = Optional.empty(); + } else { + this.salesTaxRate = Optional.of(salesTaxRate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -436,6 +657,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -447,6 +679,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ItemRequestRequest build() { return new ItemRequestRequest( name, 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..d1493d94e 100644 --- a/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -45,11 +48,11 @@ public final class ItemsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -65,9 +68,9 @@ private ItemsListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.companyId = companyId; @@ -178,15 +181,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -194,10 +200,16 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -278,11 +290,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -470,12 +482,12 @@ public Builder pageSize(Integer pageSize) { *

        Deprecated. Use show_enum_origins.

        */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(ItemsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -494,16 +506,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ItemsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/ItemsListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/ItemsListRequestRemoteFields.java new file mode 100644 index 000000000..e7ca6c17c --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequestRemoteFields.java @@ -0,0 +1,74 @@ +/** + * 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 ItemsListRequestRemoteFields { + public static final ItemsListRequestRemoteFields STATUS = new ItemsListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ItemsListRequestRemoteFields(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 ItemsListRequestRemoteFields + && this.string.equals(((ItemsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ItemsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/ItemsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..a6e65c41e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ItemsListRequestShowEnumOrigins { + public static final ItemsListRequestShowEnumOrigins STATUS = + new ItemsListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ItemsListRequestShowEnumOrigins(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 ItemsListRequestShowEnumOrigins + && this.string.equals(((ItemsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ItemsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ItemsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..9e68f105a --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ItemsMetaPatchRetrieveRequest.Builder.class) +public final class ItemsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private ItemsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ItemsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ItemsMetaPatchRetrieveRequest other) { + return this; + } + + public ItemsMetaPatchRetrieveRequest build() { + return new ItemsMetaPatchRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java index 1af183b67..ddfcc2cd6 100644 --- a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequest.java @@ -28,9 +28,9 @@ public final class ItemsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -38,8 +38,8 @@ private ItemsRetrieveRequest( Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -131,9 +131,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

        Deprecated. Use show_enum_origins.

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

        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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ItemsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..802a015d9 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 ItemsRetrieveRequestRemoteFields { + public static final ItemsRetrieveRequestRemoteFields STATUS = + new ItemsRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ItemsRetrieveRequestRemoteFields(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 ItemsRetrieveRequestRemoteFields + && this.string.equals(((ItemsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ItemsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..ccbd01986 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/ItemsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ItemsRetrieveRequestShowEnumOrigins { + public static final ItemsRetrieveRequestShowEnumOrigins STATUS = + new ItemsRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + ItemsRetrieveRequestShowEnumOrigins(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 ItemsRetrieveRequestShowEnumOrigins + && this.string.equals(((ItemsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ItemsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new ItemsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..42b18df7f 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesLinesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..8c3ba15fe 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -189,24 +192,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -511,6 +541,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

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

        */ @@ -525,6 +566,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

        */ @@ -539,6 +591,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public JournalEntriesListRequest build() { return new JournalEntriesListRequest( expand, 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..74734b47a 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntriesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..827860148 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntry.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntry.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -130,8 +133,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -154,8 +160,11 @@ public Optional getModifiedAt() { /** * @return The journal entry's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } @@ -178,8 +187,11 @@ public Optional>> getAppliedPayme /** * @return The journal entry's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } @@ -494,32 +506,44 @@ public Optional getMemo() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The journal entry's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the journal entry belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -531,8 +555,11 @@ public Optional> getLines() { /** * @return Reference number for identifying journal entries. */ - @JsonProperty("journal_number") + @JsonIgnore public Optional getJournalNumber() { + if (journalNumber == null) { + return Optional.empty(); + } return journalNumber; } @@ -556,42 +583,60 @@ public Optional getRemoteWasDeleted() { *
    • POSTED - POSTED
    • *
    */ - @JsonProperty("posting_status") + @JsonIgnore public Optional getPostingStatus() { + if (postingStatus == null) { + return Optional.empty(); + } return postingStatus; } /** * @return The accounting period that the JournalEntry was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } /** * @return When the third party's journal entry was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's journal entry was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -600,6 +645,90 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("journal_number") + private Optional _getJournalNumber() { + return journalNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posting_status") + private Optional _getPostingStatus() { + return postingStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -779,6 +908,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -821,6 +961,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    Array of Payment object IDs.

    */ @@ -863,6 +1014,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The journal's currency.

    *
      @@ -1185,6 +1347,17 @@ public Builder currency(JournalEntryCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The journal entry's exchange rate.

      */ @@ -1199,6 +1372,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the journal entry belongs to.

      */ @@ -1213,6 +1397,17 @@ public Builder company(JournalEntryCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

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

      */ @@ -1227,6 +1422,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + @JsonSetter(value = "lines", nulls = Nulls.SKIP) public Builder lines(Optional> lines) { this.lines = lines; @@ -1252,6 +1458,17 @@ public Builder journalNumber(String journalNumber) { return this; } + public Builder journalNumber(Nullable journalNumber) { + if (journalNumber.isNull()) { + this.journalNumber = null; + } else if (journalNumber.isEmpty()) { + this.journalNumber = Optional.empty(); + } else { + this.journalNumber = Optional.of(journalNumber.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1296,6 +1513,17 @@ public Builder postingStatus(JournalEntryPostingStatus postingStatus) { return this; } + public Builder postingStatus(Nullable postingStatus) { + if (postingStatus.isNull()) { + this.postingStatus = null; + } else if (postingStatus.isEmpty()) { + this.postingStatus = Optional.empty(); + } else { + this.postingStatus = Optional.of(postingStatus.get()); + } + return this; + } + /** *

      The accounting period that the JournalEntry was generated in.

      */ @@ -1310,6 +1538,17 @@ public Builder accountingPeriod(JournalEntryAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

      When the third party's journal entry was created.

      */ @@ -1324,6 +1563,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

      When the third party's journal entry was updated.

      */ @@ -1338,6 +1588,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -1349,6 +1610,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1360,6 +1632,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..e225ed2c6 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalEntryRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -89,8 +92,11 @@ private JournalEntryRequest( /** * @return The journal entry's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } @@ -105,8 +111,11 @@ public Optional>> getPayments() { /** * @return The journal entry's private note. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } @@ -421,24 +430,33 @@ public Optional getMemo() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The journal entry's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the journal entry belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -450,8 +468,11 @@ public Optional>> getTr /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -463,8 +484,11 @@ public Optional> getLines() { /** * @return Reference number for identifying journal entries. */ - @JsonProperty("journal_number") + @JsonIgnore public Optional getJournalNumber() { + if (journalNumber == null) { + return Optional.empty(); + } return journalNumber; } @@ -475,18 +499,27 @@ public Optional getJournalNumber() { *
  • POSTED - POSTED
  • * */ - @JsonProperty("posting_status") + @JsonIgnore public Optional getPostingStatus() { + if (postingStatus == null) { + return Optional.empty(); + } return postingStatus; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -495,6 +528,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("journal_number") + private Optional _getJournalNumber() { + return journalNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("posting_status") + private Optional _getPostingStatus() { + return postingStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -619,6 +712,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    Array of Payment object IDs.

    */ @@ -647,6 +751,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The journal's currency.

    *
      @@ -969,6 +1084,17 @@ public Builder currency(JournalEntryRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The journal entry's exchange rate.

      */ @@ -983,6 +1109,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the journal entry belongs to.

      */ @@ -997,6 +1134,17 @@ public Builder company(JournalEntryRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1024,6 +1172,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + @JsonSetter(value = "lines", nulls = Nulls.SKIP) public Builder lines(Optional> lines) { this.lines = lines; @@ -1049,6 +1208,17 @@ public Builder journalNumber(String journalNumber) { return this; } + public Builder journalNumber(Nullable journalNumber) { + if (journalNumber.isNull()) { + this.journalNumber = null; + } else if (journalNumber.isEmpty()) { + this.journalNumber = Optional.empty(); + } else { + this.journalNumber = Optional.of(journalNumber.get()); + } + return this; + } + /** *

      The journal's posting status.

      *
        @@ -1067,6 +1237,17 @@ public Builder postingStatus(JournalEntryRequestPostingStatus postingStatus) { return this; } + public Builder postingStatus(Nullable postingStatus) { + if (postingStatus.isNull()) { + this.postingStatus = null; + } else if (postingStatus.isEmpty()) { + this.postingStatus = Optional.empty(); + } else { + this.postingStatus = Optional.of(postingStatus.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1078,6 +1259,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1089,6 +1281,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/accounting/types/JournalLine.java b/src/main/java/com/merge/api/accounting/types/JournalLine.java index de0f17d7f..825e5137c 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalLine.java +++ b/src/main/java/com/merge/api/accounting/types/JournalLine.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -109,8 +112,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,21 +136,30 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The value of the line item including taxes and other fees. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -467,55 +482,79 @@ public Optional>> getTrackingCa *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The company the journal entry belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The line's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The journal line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } @@ -532,6 +571,78 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -686,6 +797,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -725,6 +847,17 @@ public Builder account(JournalLineAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The value of the line item including taxes and other fees.

      */ @@ -739,6 +872,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -750,6 +894,17 @@ public Builder trackingCategory(JournalLineTrackingCategory trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

      The journal line item's associated tracking categories.

      */ @@ -1087,6 +1242,17 @@ public Builder currency(JournalLineCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The company the journal entry belongs to.

      */ @@ -1101,6 +1267,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "employee", nulls = Nulls.SKIP) public Builder employee(Optional employee) { this.employee = employee; @@ -1112,6 +1289,17 @@ public Builder employee(String employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -1123,6 +1311,17 @@ public Builder project(JournalLineProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + @JsonSetter(value = "contact", nulls = Nulls.SKIP) public Builder contact(Optional contact) { this.contact = contact; @@ -1134,6 +1333,17 @@ public Builder contact(String contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

      The tax rate that applies to this line item.

      */ @@ -1148,6 +1358,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

      The line's description.

      */ @@ -1162,6 +1383,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

      The journal line item's exchange rate.

      */ @@ -1176,6 +1408,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + 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.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java b/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java index 38c183ba5..61d1f781a 100644 --- a/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/JournalLineRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -96,26 +99,38 @@ private JournalLineRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The value of the line item including taxes and other fees. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -438,65 +453,95 @@ public Optional>> getTra *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The company the journal entry belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The line's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The journal line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -505,6 +550,90 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -639,6 +768,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + @JsonSetter(value = "account", nulls = Nulls.SKIP) public Builder account(Optional account) { this.account = account; @@ -650,6 +790,17 @@ public Builder account(JournalLineRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The value of the line item including taxes and other fees.

    */ @@ -664,6 +815,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + @JsonSetter(value = "tracking_category", nulls = Nulls.SKIP) public Builder trackingCategory(Optional trackingCategory) { this.trackingCategory = trackingCategory; @@ -675,6 +837,17 @@ public Builder trackingCategory(JournalLineRequestTrackingCategory trackingCateg return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

    The journal line item's associated tracking categories.

    */ @@ -1012,6 +1185,17 @@ public Builder currency(JournalLineRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

    The company the journal entry belongs to.

    */ @@ -1026,6 +1210,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "employee", nulls = Nulls.SKIP) public Builder employee(Optional employee) { this.employee = employee; @@ -1037,6 +1232,17 @@ public Builder employee(String employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -1048,6 +1254,17 @@ public Builder project(JournalLineRequestProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + @JsonSetter(value = "contact", nulls = Nulls.SKIP) public Builder contact(Optional contact) { this.contact = contact; @@ -1059,6 +1276,17 @@ public Builder contact(String contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

    The tax rate that applies to this line item.

    */ @@ -1073,6 +1301,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

    The line's description.

    */ @@ -1087,6 +1326,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The journal line item's exchange rate.

    */ @@ -1101,6 +1351,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1112,6 +1373,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1123,6 +1395,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..75f4c4c54 100644 --- a/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
  • filestorage - filestorage
  • * */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

    The pagination cursor value.

    */ 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..898e71b71 100644 --- a/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/accounting/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -72,24 +75,51 @@ public String getData() { *
  • GZIP_BASE64 - GZIP_BASE64
  • * */ - @JsonProperty("encoding") + @JsonIgnore public Optional getEncoding() { + if (encoding == null) { + return Optional.empty(); + } return encoding; } /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encoding") + private Optional _getEncoding() { + return encoding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -157,6 +187,8 @@ public interface _FinalStage { _FinalStage encoding(EncodingEnum encoding); + _FinalStage encoding(Nullable encoding); + /** *

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

    */ @@ -164,12 +196,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

    The MIME type of the file, if the field is for a file.

    */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +259,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +295,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. @@ -263,6 +331,27 @@ public _FinalStage fileName(Optional fileName) { return this; } + /** + *

    The encoding of the value of data. Defaults to RAW if not defined.

    + *
      + *
    • RAW - RAW
    • + *
    • BASE64 - BASE64
    • + *
    • GZIP_BASE64 - GZIP_BASE64
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(Nullable encoding) { + if (encoding.isNull()) { + this.encoding = null; + } else if (encoding.isEmpty()) { + this.encoding = Optional.empty(); + } else { + this.encoding = Optional.of(encoding.get()); + } + return this; + } + /** *

    The encoding of the value of data. Defaults to RAW if not defined.

    *
      diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java index f6e37cdd4..c5c5a5e4f 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java index 8104c6a81..633895c51 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java index 63c4306a2..1746819ca 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingAttachmentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountingAttachmentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java index 83688cc50..890d45b7e 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAccountingPeriodList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountingPeriodList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java index 989ce938b..5f3c2f359 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java index 8d5ee602e..e93dcce99 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBalanceSheetList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedBalanceSheetList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java index 9c953bd66..02dd4019f 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedAccountList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedBankFeedAccountList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java index 53132d3ec..94de38573 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedBankFeedTransactionList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedBankFeedTransactionList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java index 7bc1fc307..d6bebb012 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCashFlowStatementList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCashFlowStatementList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java index ecae22ab9..8d893507f 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCompanyInfoList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCompanyInfoList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java b/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java index d4e311ed8..53379dcc4 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedContactList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedContactList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java b/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java index 483245729..455aca0aa 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedCreditNoteList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCreditNoteList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java index 5bda45a47..9e65a2f67 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedEmployeeList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEmployeeList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java index 1345682e0..8212c8261 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedExpenseList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedExpenseList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java index c43c8976b..243891ad7 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedGeneralLedgerTransactionList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedGeneralLedgerTransactionList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java b/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java index a9035ab04..64f6b4d76 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedIncomeStatementList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIncomeStatementList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java b/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java index 834aaffbf..1bc074ed7 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedInvoiceList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedInvoiceList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java b/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java index 0c1942457..a29e29800 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java b/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java index 2033687e8..c40d2f06e 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedItemList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedItemList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java b/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java index 501f90eea..5e1d1cdc9 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedJournalEntryList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedJournalEntryList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java index 8c40e422b..e93c1683e 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPaymentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java index 4739ebdde..d939744a4 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentMethodList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPaymentMethodList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java index f73c2d301..29fbd04d0 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPaymentTermList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPaymentTermList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedProjectList.java b/src/main/java/com/merge/api/accounting/types/PaginatedProjectList.java index 29c4cf79d..ef6a27345 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedProjectList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedProjectList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedProjectList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java b/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java index 7c61f8260..fb59c577a 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedPurchaseOrderList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPurchaseOrderList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java index dff9c4146..66b4e9814 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedRemoteFieldClassList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRemoteFieldClassList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java index 46152f3fd..463e9672d 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java index f82935c7d..753536386 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTaxRateList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTaxRateList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java index ff1171442..d180ffda8 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTrackingCategoryList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTrackingCategoryList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java b/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java index cc8f83e62..dbba2160a 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedTransactionList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTransactionList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java b/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java index 46d763068..1c7be2614 100644 --- a/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java +++ b/src/main/java/com/merge/api/accounting/types/PaginatedVendorCreditList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedVendorCreditList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/accounting/types/PatchedItemRequestRequest.java b/src/main/java/com/merge/api/accounting/types/PatchedItemRequestRequest.java index a173ca58f..ed6ca72b1 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedItemRequestRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedItemRequestRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -79,8 +82,11 @@ private PatchedItemRequestRequest( /** * @return The item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -91,8 +97,11 @@ public Optional getName() { *
    • ARCHIVED - ARCHIVED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -105,74 +114,176 @@ public Optional getStatus() { *
  • UNKNOWN - UNKNOWN
  • * */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return The item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The price at which the item is purchased from a vendor. */ - @JsonProperty("purchase_price") + @JsonIgnore public Optional getPurchasePrice() { + if (purchasePrice == null) { + return Optional.empty(); + } return purchasePrice; } /** * @return References the default account used to record a purchase of the item. */ - @JsonProperty("purchase_account") + @JsonIgnore public Optional getPurchaseAccount() { + if (purchaseAccount == null) { + return Optional.empty(); + } return purchaseAccount; } /** * @return References the default account used to record a sale. */ - @JsonProperty("sales_account") + @JsonIgnore public Optional getSalesAccount() { + if (salesAccount == null) { + return Optional.empty(); + } return salesAccount; } /** * @return The company the item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The default purchase tax rate for this item. */ - @JsonProperty("purchase_tax_rate") + @JsonIgnore public Optional getPurchaseTaxRate() { + if (purchaseTaxRate == null) { + return Optional.empty(); + } return purchaseTaxRate; } /** * @return The default sales tax rate for this item. */ - @JsonProperty("sales_tax_rate") + @JsonIgnore public Optional getSalesTaxRate() { + if (salesTaxRate == null) { + return Optional.empty(); + } return salesTaxRate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_price") + private Optional _getPurchasePrice() { + return purchasePrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_account") + private Optional _getPurchaseAccount() { + return purchaseAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_account") + private Optional _getSalesAccount() { + return salesAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_tax_rate") + private Optional _getPurchaseTaxRate() { + return purchaseTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sales_tax_rate") + private Optional _getSalesTaxRate() { + return salesTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -289,6 +400,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The item's status.

    *
      @@ -307,6 +429,17 @@ public Builder status(PatchedItemRequestRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The item's type.

      *
        @@ -327,6 +460,17 @@ public Builder type(PatchedItemRequestRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

        The item's unit price.

        */ @@ -341,6 +485,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

        The price at which the item is purchased from a vendor.

        */ @@ -355,6 +510,17 @@ public Builder purchasePrice(Double purchasePrice) { return this; } + public Builder purchasePrice(Nullable purchasePrice) { + if (purchasePrice.isNull()) { + this.purchasePrice = null; + } else if (purchasePrice.isEmpty()) { + this.purchasePrice = Optional.empty(); + } else { + this.purchasePrice = Optional.of(purchasePrice.get()); + } + return this; + } + /** *

        References the default account used to record a purchase of the item.

        */ @@ -369,6 +535,17 @@ public Builder purchaseAccount(String purchaseAccount) { return this; } + public Builder purchaseAccount(Nullable purchaseAccount) { + if (purchaseAccount.isNull()) { + this.purchaseAccount = null; + } else if (purchaseAccount.isEmpty()) { + this.purchaseAccount = Optional.empty(); + } else { + this.purchaseAccount = Optional.of(purchaseAccount.get()); + } + return this; + } + /** *

        References the default account used to record a sale.

        */ @@ -383,6 +560,17 @@ public Builder salesAccount(String salesAccount) { return this; } + public Builder salesAccount(Nullable salesAccount) { + if (salesAccount.isNull()) { + this.salesAccount = null; + } else if (salesAccount.isEmpty()) { + this.salesAccount = Optional.empty(); + } else { + this.salesAccount = Optional.of(salesAccount.get()); + } + return this; + } + /** *

        The company the item belongs to.

        */ @@ -397,6 +585,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The default purchase tax rate for this item.

        */ @@ -411,6 +610,17 @@ public Builder purchaseTaxRate(String purchaseTaxRate) { return this; } + public Builder purchaseTaxRate(Nullable purchaseTaxRate) { + if (purchaseTaxRate.isNull()) { + this.purchaseTaxRate = null; + } else if (purchaseTaxRate.isEmpty()) { + this.purchaseTaxRate = Optional.empty(); + } else { + this.purchaseTaxRate = Optional.of(purchaseTaxRate.get()); + } + return this; + } + /** *

        The default sales tax rate for this item.

        */ @@ -425,6 +635,17 @@ public Builder salesTaxRate(String salesTaxRate) { return this; } + public Builder salesTaxRate(Nullable salesTaxRate) { + if (salesTaxRate.isNull()) { + this.salesTaxRate = null; + } else if (salesTaxRate.isEmpty()) { + this.salesTaxRate = Optional.empty(); + } else { + this.salesTaxRate = Optional.of(salesTaxRate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -436,6 +657,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -447,6 +679,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public PatchedItemRequestRequest build() { return new PatchedItemRequestRequest( name, 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..9eab36403 100644 --- a/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PatchedPaymentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -93,32 +96,44 @@ private PatchedPaymentRequest( /** * @return The payment's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The supplier, or customer involved in the payment. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The supplier’s or customer’s account in which the payment is made. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The method which this payment was made by. */ - @JsonProperty("payment_method") + @JsonIgnore public Optional getPaymentMethod() { + if (paymentMethod == null) { + return Optional.empty(); + } return paymentMethod; } @@ -433,32 +448,44 @@ public Optional getPaymentMethod() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The payment's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the payment belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The total amount of money being paid to the supplier, or customer, after taxes. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -469,8 +496,11 @@ public Optional getTotalAmount() { *
    • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -482,8 +512,11 @@ public Optional>> get /** * @return The accounting period that the Payment was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -495,13 +528,19 @@ public Optional> getAppliedToLines return appliedToLines; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -510,6 +549,78 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method") + private Optional _getPaymentMethod() { + return paymentMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -639,6 +750,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    The supplier, or customer involved in the payment.

    */ @@ -653,6 +775,17 @@ public Builder contact(PatchedPaymentRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

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

    */ @@ -667,6 +800,17 @@ public Builder account(PatchedPaymentRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The method which this payment was made by.

    */ @@ -681,6 +825,17 @@ public Builder paymentMethod(PatchedPaymentRequestPaymentMethod paymentMethod) { return this; } + public Builder paymentMethod(Nullable paymentMethod) { + if (paymentMethod.isNull()) { + this.paymentMethod = null; + } else if (paymentMethod.isEmpty()) { + this.paymentMethod = Optional.empty(); + } else { + this.paymentMethod = Optional.of(paymentMethod.get()); + } + return this; + } + /** *

    The payment's currency.

    *
      @@ -1003,6 +1158,17 @@ public Builder currency(PatchedPaymentRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The payment's exchange rate.

      */ @@ -1017,6 +1183,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the payment belongs to.

      */ @@ -1031,6 +1208,17 @@ public Builder company(PatchedPaymentRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The total amount of money being paid to the supplier, or customer, after taxes.

      */ @@ -1045,6 +1233,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The type of the invoice.

      *
        @@ -1063,6 +1262,17 @@ public Builder type(PatchedPaymentRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1090,6 +1300,17 @@ public Builder accountingPeriod(PatchedPaymentRequestAccountingPeriod accounting return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

        A list of “Payment Applied to Lines” objects.

        */ @@ -1115,6 +1336,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1126,6 +1358,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..fc619d9dc 100644 --- a/src/main/java/com/merge/api/accounting/types/Payment.java +++ b/src/main/java/com/merge/api/accounting/types/Payment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -122,8 +125,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -146,32 +152,44 @@ public Optional getModifiedAt() { /** * @return The payment's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The supplier, or customer involved in the payment. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The supplier’s or customer’s account in which the payment is made. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The method which this payment was made by. */ - @JsonProperty("payment_method") + @JsonIgnore public Optional getPaymentMethod() { + if (paymentMethod == null) { + return Optional.empty(); + } return paymentMethod; } @@ -486,32 +504,44 @@ public Optional getPaymentMethod() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The payment's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the payment belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The total amount of money being paid to the supplier, or customer, after taxes. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -522,8 +552,11 @@ public Optional getTotalAmount() { *
    • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -535,8 +568,11 @@ public Optional>> getTrackingCatego /** * @return The accounting period that the Payment was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -551,8 +587,11 @@ public Optional> getAppliedToLines() { /** * @return When the third party's payment entry was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -564,13 +603,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -579,6 +624,90 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method") + private Optional _getPaymentMethod() { + return paymentMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -748,6 +877,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -790,6 +930,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    The supplier, or customer involved in the payment.

    */ @@ -804,6 +955,17 @@ public Builder contact(PaymentContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

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

    */ @@ -818,6 +980,17 @@ public Builder account(PaymentAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The method which this payment was made by.

    */ @@ -832,6 +1005,17 @@ public Builder paymentMethod(PaymentPaymentMethod paymentMethod) { return this; } + public Builder paymentMethod(Nullable paymentMethod) { + if (paymentMethod.isNull()) { + this.paymentMethod = null; + } else if (paymentMethod.isEmpty()) { + this.paymentMethod = Optional.empty(); + } else { + this.paymentMethod = Optional.of(paymentMethod.get()); + } + return this; + } + /** *

    The payment's currency.

    *
      @@ -1154,6 +1338,17 @@ public Builder currency(PaymentCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The payment's exchange rate.

      */ @@ -1168,6 +1363,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the payment belongs to.

      */ @@ -1182,6 +1388,17 @@ public Builder company(PaymentCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The total amount of money being paid to the supplier, or customer, after taxes.

      */ @@ -1196,6 +1413,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The type of the invoice.

      *
        @@ -1214,6 +1442,17 @@ public Builder type(PaymentType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories(Optional>> trackingCategories) { this.trackingCategories = trackingCategories; @@ -1239,6 +1478,17 @@ public Builder accountingPeriod(PaymentAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

        A list of “Payment Applied to Lines” objects.

        */ @@ -1267,6 +1517,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

        */ @@ -1292,6 +1553,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1303,6 +1575,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java b/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java index 640d4b467..3fc1fec41 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentLineItem.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -68,8 +71,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -92,16 +98,22 @@ public Optional getModifiedAt() { /** * @return The amount being applied to the transaction. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } /** * @return The date the payment portion is applied. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } @@ -121,6 +133,24 @@ public Optional getRelatedObjectType() { return relatedObjectType; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -225,6 +255,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -267,6 +308,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + return this; + } + /** *

        The date the payment portion is applied.

        */ @@ -281,6 +333,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The Merge ID of the transaction the payment portion is being applied to.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java index 383bdc0fc..110c8d877 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentLineItemRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -65,24 +68,33 @@ private PaymentLineItemRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return The amount being applied to the transaction. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } /** * @return The date the payment portion is applied. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } @@ -102,13 +114,19 @@ public Optional getRelatedObjectType() { return relatedObjectType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -117,6 +135,36 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -210,6 +258,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The amount being applied to the transaction.

        */ @@ -224,6 +283,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + return this; + } + /** *

        The date the payment portion is applied.

        */ @@ -238,6 +308,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The Merge ID of the transaction the payment portion is being applied to.

        */ @@ -277,6 +358,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -288,6 +380,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..1d02caf9e 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentMethod.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentMethod.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -79,8 +82,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,18 +140,51 @@ public Optional getIsActive() { /** * @return When the third party's payment method was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -234,6 +273,8 @@ public interface _FinalStage { _FinalStage remoteId(String remoteId); + _FinalStage remoteId(Nullable remoteId); + /** *

        The datetime that this object was created by Merge.

        */ @@ -262,13 +303,19 @@ public interface _FinalStage { _FinalStage remoteUpdatedAt(OffsetDateTime remoteUpdatedAt); + _FinalStage remoteUpdatedAt(Nullable remoteUpdatedAt); + _FinalStage fieldMappings(Optional> fieldMappings); _FinalStage fieldMappings(Map fieldMappings); + _FinalStage fieldMappings(Nullable> fieldMappings); + _FinalStage remoteData(Optional> remoteData); _FinalStage remoteData(List remoteData); + + _FinalStage remoteData(Nullable> remoteData); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -351,6 +398,18 @@ public _FinalStage name(@NotNull String name) { return this; } + @java.lang.Override + public _FinalStage remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteData(List remoteData) { this.remoteData = Optional.ofNullable(remoteData); @@ -364,6 +423,18 @@ public _FinalStage remoteData(Optional> remoteData) { return this; } + @java.lang.Override + public _FinalStage fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @java.lang.Override public _FinalStage fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.ofNullable(fieldMappings); @@ -377,6 +448,22 @@ public _FinalStage fieldMappings(Optional> fieldMappings) return this; } + /** + *

        When the third party's payment method was updated.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

        When the third party's payment method was updated.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -457,6 +544,22 @@ public _FinalStage createdAt(Optional createdAt) { return this; } + /** + *

        The third-party API ID of the matching object.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The third-party API ID of the matching object.

        * @return Reference to {@code this} so that method calls can be chained together. 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..bfc8fb854 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -93,32 +96,44 @@ private PaymentRequest( /** * @return The payment's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The supplier, or customer involved in the payment. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The supplier’s or customer’s account in which the payment is made. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The method which this payment was made by. */ - @JsonProperty("payment_method") + @JsonIgnore public Optional getPaymentMethod() { + if (paymentMethod == null) { + return Optional.empty(); + } return paymentMethod; } @@ -433,32 +448,44 @@ public Optional getPaymentMethod() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The payment's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the payment belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The total amount of money being paid to the supplier, or customer, after taxes. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -469,8 +496,11 @@ public Optional getTotalAmount() { *
    • ACCOUNTS_RECEIVABLE - ACCOUNTS_RECEIVABLE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -482,8 +512,11 @@ public Optional>> getTrackin /** * @return The accounting period that the Payment was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } @@ -495,13 +528,19 @@ public Optional> getAppliedToLines() { return appliedToLines; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -510,6 +549,78 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method") + private Optional _getPaymentMethod() { + return paymentMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -638,6 +749,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

    The supplier, or customer involved in the payment.

    */ @@ -652,6 +774,17 @@ public Builder contact(PaymentRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

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

    */ @@ -666,6 +799,17 @@ public Builder account(PaymentRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The method which this payment was made by.

    */ @@ -680,6 +824,17 @@ public Builder paymentMethod(PaymentRequestPaymentMethod paymentMethod) { return this; } + public Builder paymentMethod(Nullable paymentMethod) { + if (paymentMethod.isNull()) { + this.paymentMethod = null; + } else if (paymentMethod.isEmpty()) { + this.paymentMethod = Optional.empty(); + } else { + this.paymentMethod = Optional.of(paymentMethod.get()); + } + return this; + } + /** *

    The payment's currency.

    *
      @@ -1002,6 +1157,17 @@ public Builder currency(PaymentRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The payment's exchange rate.

      */ @@ -1016,6 +1182,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the payment belongs to.

      */ @@ -1030,6 +1207,17 @@ public Builder company(PaymentRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

      The total amount of money being paid to the supplier, or customer, after taxes.

      */ @@ -1044,6 +1232,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The type of the invoice.

      *
        @@ -1062,6 +1261,17 @@ public Builder type(PaymentRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1088,6 +1298,17 @@ public Builder accountingPeriod(PaymentRequestAccountingPeriod accountingPeriod) return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

        A list of “Payment Applied to Lines” objects.

        */ @@ -1113,6 +1334,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1124,6 +1356,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..cd4238973 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentTerm.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTerm.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -87,8 +90,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -127,42 +133,102 @@ public Optional getIsActive() { /** * @return The subsidiary that the payment term belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The number of days after the invoice date that payment is due. */ - @JsonProperty("days_until_due") + @JsonIgnore public Optional getDaysUntilDue() { + if (daysUntilDue == null) { + return Optional.empty(); + } return daysUntilDue; } /** * @return The number of days the invoice must be paid before discounts expire. */ - @JsonProperty("discount_days") + @JsonIgnore public Optional getDiscountDays() { + if (discountDays == null) { + return Optional.empty(); + } return discountDays; } /** * @return When the third party's payment term was modified. */ - @JsonProperty("remote_last_modified_at") + @JsonIgnore public Optional getRemoteLastModifiedAt() { + if (remoteLastModifiedAt == null) { + return Optional.empty(); + } return remoteLastModifiedAt; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("days_until_due") + private Optional _getDaysUntilDue() { + return daysUntilDue; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("discount_days") + private Optional _getDiscountDays() { + return discountDays; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_last_modified_at") + private Optional _getRemoteLastModifiedAt() { + return remoteLastModifiedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -241,6 +307,8 @@ public interface _FinalStage { _FinalStage remoteId(String remoteId); + _FinalStage remoteId(Nullable remoteId); + /** *

        The datetime that this object was created by Merge.

        */ @@ -269,6 +337,8 @@ public interface _FinalStage { _FinalStage company(PaymentTermCompany company); + _FinalStage company(Nullable company); + /** *

        The number of days after the invoice date that payment is due.

        */ @@ -276,6 +346,8 @@ public interface _FinalStage { _FinalStage daysUntilDue(Integer daysUntilDue); + _FinalStage daysUntilDue(Nullable daysUntilDue); + /** *

        The number of days the invoice must be paid before discounts expire.

        */ @@ -283,6 +355,8 @@ public interface _FinalStage { _FinalStage discountDays(Integer discountDays); + _FinalStage discountDays(Nullable discountDays); + /** *

        When the third party's payment term was modified.

        */ @@ -290,13 +364,19 @@ public interface _FinalStage { _FinalStage remoteLastModifiedAt(OffsetDateTime remoteLastModifiedAt); + _FinalStage remoteLastModifiedAt(Nullable remoteLastModifiedAt); + _FinalStage fieldMappings(Optional> fieldMappings); _FinalStage fieldMappings(Map fieldMappings); + _FinalStage fieldMappings(Nullable> fieldMappings); + _FinalStage remoteData(Optional> remoteData); _FinalStage remoteData(List remoteData); + + _FinalStage remoteData(Nullable> remoteData); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -359,6 +439,18 @@ public _FinalStage name(@NotNull String name) { return this; } + @java.lang.Override + public _FinalStage remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteData(List remoteData) { this.remoteData = Optional.ofNullable(remoteData); @@ -372,6 +464,18 @@ public _FinalStage remoteData(Optional> remoteData) { return this; } + @java.lang.Override + public _FinalStage fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @java.lang.Override public _FinalStage fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.ofNullable(fieldMappings); @@ -385,6 +489,22 @@ public _FinalStage fieldMappings(Optional> fieldMappings) return this; } + /** + *

        When the third party's payment term was modified.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteLastModifiedAt(Nullable remoteLastModifiedAt) { + if (remoteLastModifiedAt.isNull()) { + this.remoteLastModifiedAt = null; + } else if (remoteLastModifiedAt.isEmpty()) { + this.remoteLastModifiedAt = Optional.empty(); + } else { + this.remoteLastModifiedAt = Optional.of(remoteLastModifiedAt.get()); + } + return this; + } + /** *

        When the third party's payment term was modified.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -405,6 +525,22 @@ public _FinalStage remoteLastModifiedAt(Optional remoteLastModif return this; } + /** + *

        The number of days the invoice must be paid before discounts expire.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage discountDays(Nullable discountDays) { + if (discountDays.isNull()) { + this.discountDays = null; + } else if (discountDays.isEmpty()) { + this.discountDays = Optional.empty(); + } else { + this.discountDays = Optional.of(discountDays.get()); + } + return this; + } + /** *

        The number of days the invoice must be paid before discounts expire.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -425,6 +561,22 @@ public _FinalStage discountDays(Optional discountDays) { return this; } + /** + *

        The number of days after the invoice date that payment is due.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage daysUntilDue(Nullable daysUntilDue) { + if (daysUntilDue.isNull()) { + this.daysUntilDue = null; + } else if (daysUntilDue.isEmpty()) { + this.daysUntilDue = Optional.empty(); + } else { + this.daysUntilDue = Optional.of(daysUntilDue.get()); + } + return this; + } + /** *

        The number of days after the invoice date that payment is due.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -445,6 +597,22 @@ public _FinalStage daysUntilDue(Optional daysUntilDue) { return this; } + /** + *

        The subsidiary that the payment term belongs to.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The subsidiary that the payment term belongs to.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -525,6 +693,22 @@ public _FinalStage createdAt(Optional createdAt) { return this; } + /** + *

        The third-party API ID of the matching object.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The third-party API ID of the matching object.

        * @return Reference to {@code this} so that method calls can be chained together. 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..79c21026a 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PaymentTermsListRequest.Builder.class) public final class PaymentTermsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional cursor; @@ -37,7 +37,7 @@ public final class PaymentTermsListRequest { private final Map additionalProperties; private PaymentTermsListRequest( - Optional> expand, + Optional> expand, Optional cursor, Optional includeDeletedData, Optional includeRemoteData, @@ -57,7 +57,7 @@ private PaymentTermsListRequest( * @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; } @@ -143,7 +143,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 cursor = Optional.empty(); @@ -174,17 +174,17 @@ public Builder from(PaymentTermsListRequest 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(PaymentTermsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequestExpandItem.java new file mode 100644 index 000000000..92ecf4496 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 PaymentTermsListRequestExpandItem { + public static final PaymentTermsListRequestExpandItem COMPANY = + new PaymentTermsListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + PaymentTermsListRequestExpandItem(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 PaymentTermsListRequestExpandItem + && this.string.equals(((PaymentTermsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PaymentTermsListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new PaymentTermsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java index 6408c1345..3189aeec9 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = PaymentTermsRetrieveRequest.Builder.class) public final class PaymentTermsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class PaymentTermsRetrieveRequest { private final Map additionalProperties; private PaymentTermsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private PaymentTermsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(PaymentTermsRetrieveRequest 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(PaymentTermsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..16ac240b3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentTermsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 PaymentTermsRetrieveRequestExpandItem { + public static final PaymentTermsRetrieveRequestExpandItem COMPANY = + new PaymentTermsRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + PaymentTermsRetrieveRequestExpandItem(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 PaymentTermsRetrieveRequestExpandItem + && this.string.equals(((PaymentTermsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PaymentTermsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new PaymentTermsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} 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..31ec3a28c 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsLineItemsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..34530e227 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -213,24 +216,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -573,6 +603,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

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

        */ @@ -587,6 +628,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

        */ @@ -601,6 +653,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public PaymentsListRequest build() { return new PaymentsListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/PaymentsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PaymentsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..e228a0679 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PaymentsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = PaymentsMetaPatchRetrieveRequest.Builder.class) +public final class PaymentsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private PaymentsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof PaymentsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(PaymentsMetaPatchRetrieveRequest other) { + return this; + } + + public PaymentsMetaPatchRetrieveRequest build() { + return new PaymentsMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..9ba6bd65b 100644 --- a/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PaymentsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..90c44fe71 100644 --- a/src/main/java/com/merge/api/accounting/types/Project.java +++ b/src/main/java/com/merge/api/accounting/types/Project.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -79,8 +82,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -119,26 +125,68 @@ public Optional getIsActive() { /** * @return The subsidiary that the project belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The supplier, or customer involved in the project. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -213,6 +261,8 @@ public interface _FinalStage { _FinalStage remoteId(String remoteId); + _FinalStage remoteId(Nullable remoteId); + /** *

        The datetime that this object was created by Merge.

        */ @@ -241,6 +291,8 @@ public interface _FinalStage { _FinalStage company(ProjectCompany company); + _FinalStage company(Nullable company); + /** *

        The supplier, or customer involved in the project.

        */ @@ -248,13 +300,19 @@ public interface _FinalStage { _FinalStage contact(ProjectContact contact); + _FinalStage contact(Nullable contact); + _FinalStage fieldMappings(Optional> fieldMappings); _FinalStage fieldMappings(Map fieldMappings); + _FinalStage fieldMappings(Nullable> fieldMappings); + _FinalStage remoteData(Optional> remoteData); _FinalStage remoteData(List remoteData); + + _FinalStage remoteData(Nullable> remoteData); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -311,6 +369,18 @@ public _FinalStage name(@NotNull String name) { return this; } + @java.lang.Override + public _FinalStage remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteData(List remoteData) { this.remoteData = Optional.ofNullable(remoteData); @@ -324,6 +394,18 @@ public _FinalStage remoteData(Optional> remoteData) { return this; } + @java.lang.Override + public _FinalStage fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @java.lang.Override public _FinalStage fieldMappings(Map fieldMappings) { this.fieldMappings = Optional.ofNullable(fieldMappings); @@ -337,6 +419,22 @@ public _FinalStage fieldMappings(Optional> fieldMappings) return this; } + /** + *

        The supplier, or customer involved in the project.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The supplier, or customer involved in the project.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -357,6 +455,22 @@ public _FinalStage contact(Optional contact) { return this; } + /** + *

        The subsidiary that the project belongs to.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

        The subsidiary that the project belongs to.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -437,6 +551,22 @@ public _FinalStage createdAt(Optional createdAt) { return this; } + /** + *

        The third-party API ID of the matching object.

        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The third-party API ID of the matching object.

        * @return Reference to {@code this} so that method calls can be chained together. 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..78eb4bf94 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrder.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -146,8 +149,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -177,80 +183,110 @@ public Optional getModifiedAt() { *
      • DELETED - DELETED
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The purchase order's issue date. */ - @JsonProperty("issue_date") + @JsonIgnore public Optional getIssueDate() { + if (issueDate == null) { + return Optional.empty(); + } return issueDate; } /** * @return The human-readable number of the purchase order. */ - @JsonProperty("purchase_order_number") + @JsonIgnore public Optional getPurchaseOrderNumber() { + if (purchaseOrderNumber == null) { + return Optional.empty(); + } return purchaseOrderNumber; } /** * @return The purchase order's delivery date. */ - @JsonProperty("delivery_date") + @JsonIgnore public Optional getDeliveryDate() { + if (deliveryDate == null) { + return Optional.empty(); + } return deliveryDate; } /** * @return The purchase order's delivery address. */ - @JsonProperty("delivery_address") + @JsonIgnore public Optional getDeliveryAddress() { + if (deliveryAddress == null) { + return Optional.empty(); + } return deliveryAddress; } /** * @return The contact making the purchase order. */ - @JsonProperty("customer") + @JsonIgnore public Optional getCustomer() { + if (customer == null) { + return Optional.empty(); + } return customer; } /** * @return The party fulfilling the purchase order. */ - @JsonProperty("vendor") + @JsonIgnore public Optional getVendor() { + if (vendor == null) { + return Optional.empty(); + } return vendor; } /** * @return A memo attached to the purchase order. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The company the purchase order belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The purchase order's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -565,24 +601,33 @@ public Optional getTotalAmount() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The purchase order's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The payment term that applies to this transaction. */ - @JsonProperty("payment_term") + @JsonIgnore public Optional getPaymentTerm() { + if (paymentTerm == null) { + return Optional.empty(); + } return paymentTerm; } @@ -594,8 +639,11 @@ public Optional> getLineItems() { /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } @@ -607,24 +655,33 @@ public Optional>> getTracking /** * @return The accounting period that the PurchaseOrder was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } /** * @return When the third party's purchase order note was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's purchase order note was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -636,13 +693,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -651,6 +714,126 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date") + private Optional _getIssueDate() { + return issueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("purchase_order_number") + private Optional _getPurchaseOrderNumber() { + return purchaseOrderNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("delivery_date") + private Optional _getDeliveryDate() { + return deliveryDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("delivery_address") + private Optional _getDeliveryAddress() { + return deliveryAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("customer") + private Optional _getCustomer() { + return customer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("vendor") + private Optional _getVendor() { + return vendor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_term") + private Optional _getPaymentTerm() { + return paymentTerm; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -850,6 +1033,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -899,6 +1093,17 @@ public Builder status(PurchaseOrderStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

    The purchase order's issue date.

    */ @@ -913,6 +1118,17 @@ public Builder issueDate(OffsetDateTime issueDate) { return this; } + public Builder issueDate(Nullable issueDate) { + if (issueDate.isNull()) { + this.issueDate = null; + } else if (issueDate.isEmpty()) { + this.issueDate = Optional.empty(); + } else { + this.issueDate = Optional.of(issueDate.get()); + } + return this; + } + /** *

    The human-readable number of the purchase order.

    */ @@ -927,6 +1143,17 @@ public Builder purchaseOrderNumber(String purchaseOrderNumber) { return this; } + public Builder purchaseOrderNumber(Nullable purchaseOrderNumber) { + if (purchaseOrderNumber.isNull()) { + this.purchaseOrderNumber = null; + } else if (purchaseOrderNumber.isEmpty()) { + this.purchaseOrderNumber = Optional.empty(); + } else { + this.purchaseOrderNumber = Optional.of(purchaseOrderNumber.get()); + } + return this; + } + /** *

    The purchase order's delivery date.

    */ @@ -941,6 +1168,17 @@ public Builder deliveryDate(OffsetDateTime deliveryDate) { return this; } + public Builder deliveryDate(Nullable deliveryDate) { + if (deliveryDate.isNull()) { + this.deliveryDate = null; + } else if (deliveryDate.isEmpty()) { + this.deliveryDate = Optional.empty(); + } else { + this.deliveryDate = Optional.of(deliveryDate.get()); + } + return this; + } + /** *

    The purchase order's delivery address.

    */ @@ -955,6 +1193,17 @@ public Builder deliveryAddress(PurchaseOrderDeliveryAddress deliveryAddress) { return this; } + public Builder deliveryAddress(Nullable deliveryAddress) { + if (deliveryAddress.isNull()) { + this.deliveryAddress = null; + } else if (deliveryAddress.isEmpty()) { + this.deliveryAddress = Optional.empty(); + } else { + this.deliveryAddress = Optional.of(deliveryAddress.get()); + } + return this; + } + /** *

    The contact making the purchase order.

    */ @@ -969,6 +1218,17 @@ public Builder customer(String customer) { return this; } + public Builder customer(Nullable customer) { + if (customer.isNull()) { + this.customer = null; + } else if (customer.isEmpty()) { + this.customer = Optional.empty(); + } else { + this.customer = Optional.of(customer.get()); + } + return this; + } + /** *

    The party fulfilling the purchase order.

    */ @@ -983,6 +1243,17 @@ public Builder vendor(PurchaseOrderVendor vendor) { return this; } + public Builder vendor(Nullable vendor) { + if (vendor.isNull()) { + this.vendor = null; + } else if (vendor.isEmpty()) { + this.vendor = Optional.empty(); + } else { + this.vendor = Optional.of(vendor.get()); + } + return this; + } + /** *

    A memo attached to the purchase order.

    */ @@ -997,6 +1268,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The company the purchase order belongs to.

    */ @@ -1011,6 +1293,17 @@ public Builder company(PurchaseOrderCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The purchase order's total amount.

    */ @@ -1025,6 +1318,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

    The purchase order's currency.

    *
      @@ -1347,6 +1651,17 @@ public Builder currency(PurchaseOrderCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The purchase order's exchange rate.

      */ @@ -1361,6 +1676,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The payment term that applies to this transaction.

      */ @@ -1375,6 +1701,17 @@ public Builder paymentTerm(PurchaseOrderPaymentTerm paymentTerm) { return this; } + public Builder paymentTerm(Nullable paymentTerm) { + if (paymentTerm.isNull()) { + this.paymentTerm = null; + } else if (paymentTerm.isEmpty()) { + this.paymentTerm = Optional.empty(); + } else { + this.paymentTerm = Optional.of(paymentTerm.get()); + } + return this; + } + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) public Builder lineItems(Optional> lineItems) { this.lineItems = lineItems; @@ -1400,6 +1737,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1426,6 +1774,17 @@ public Builder accountingPeriod(PurchaseOrderAccountingPeriod accountingPeriod) return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + /** *

      When the third party's purchase order note was created.

      */ @@ -1440,6 +1799,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

      When the third party's purchase order note was updated.

      */ @@ -1454,6 +1824,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

      */ @@ -1479,6 +1860,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1490,6 +1882,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItem.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItem.java index 8666d5d4c..14db64775 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItem.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,8 +116,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -137,45 +143,63 @@ public Optional getModifiedAt() { /** * @return A description of the good being purchased. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The purchase order line item's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The purchase order line item's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -190,16 +214,22 @@ public Optional>> getTrackingCategories() { /** * @return The purchase order line item's tax amount. */ - @JsonProperty("tax_amount") + @JsonIgnore public Optional getTaxAmount() { + if (taxAmount == null) { + return Optional.empty(); + } return taxAmount; } /** * @return The purchase order line item's total amount. */ - @JsonProperty("total_line_amount") + @JsonIgnore public Optional getTotalLineAmount() { + if (totalLineAmount == null) { + return Optional.empty(); + } return totalLineAmount; } @@ -514,32 +544,44 @@ public Optional getTotalLineAmount() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The purchase order line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the purchase order line item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -556,6 +598,84 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_amount") + private Optional _getTaxAmount() { + return taxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_line_amount") + private Optional _getTotalLineAmount() { + return totalLineAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -715,6 +835,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -757,6 +888,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The line item's unit price.

    */ @@ -771,6 +913,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

    The line item's quantity.

    */ @@ -785,6 +938,17 @@ public Builder quantity(Double quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -796,6 +960,17 @@ public Builder item(PurchaseOrderLineItemItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

    The purchase order line item's account.

    */ @@ -810,6 +985,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The purchase order line item's associated tracking category.

    */ @@ -824,6 +1010,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

    The purchase order line item's associated tracking categories.

    */ @@ -852,6 +1049,17 @@ public Builder taxAmount(String taxAmount) { return this; } + public Builder taxAmount(Nullable taxAmount) { + if (taxAmount.isNull()) { + this.taxAmount = null; + } else if (taxAmount.isEmpty()) { + this.taxAmount = Optional.empty(); + } else { + this.taxAmount = Optional.of(taxAmount.get()); + } + return this; + } + /** *

    The purchase order line item's total amount.

    */ @@ -866,6 +1074,17 @@ public Builder totalLineAmount(String totalLineAmount) { return this; } + public Builder totalLineAmount(Nullable totalLineAmount) { + if (totalLineAmount.isNull()) { + this.totalLineAmount = null; + } else if (totalLineAmount.isEmpty()) { + this.totalLineAmount = Optional.empty(); + } else { + this.totalLineAmount = Optional.of(totalLineAmount.get()); + } + return this; + } + /** *

    The purchase order line item's currency.

    *
      @@ -1188,6 +1407,17 @@ public Builder currency(PurchaseOrderLineItemCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The tax rate that applies to this line item.

      */ @@ -1202,6 +1432,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

      The purchase order line item's exchange rate.

      */ @@ -1216,6 +1457,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the purchase order line item belongs to.

      */ @@ -1230,6 +1482,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequest.java index 7e0d26746..1bcc936c4 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderLineItemRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -100,53 +103,74 @@ private PurchaseOrderLineItemRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return A description of the good being purchased. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The purchase order line item's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The purchase order line item's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -161,16 +185,22 @@ public Optional>> getTrackingCategories() { /** * @return The purchase order line item's tax amount. */ - @JsonProperty("tax_amount") + @JsonIgnore public Optional getTaxAmount() { + if (taxAmount == null) { + return Optional.empty(); + } return taxAmount; } /** * @return The purchase order line item's total amount. */ - @JsonProperty("total_line_amount") + @JsonIgnore public Optional getTotalLineAmount() { + if (totalLineAmount == null) { + return Optional.empty(); + } return totalLineAmount; } @@ -485,42 +515,60 @@ public Optional getTotalLineAmount() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The purchase order line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the purchase order line item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -529,6 +577,96 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_amount") + private Optional _getTaxAmount() { + return taxAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_line_amount") + private Optional _getTotalLineAmount() { + return totalLineAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -667,6 +805,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    A description of the good being purchased.

    */ @@ -681,6 +830,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The line item's unit price.

    */ @@ -695,6 +855,17 @@ public Builder unitPrice(Double unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

    The line item's quantity.

    */ @@ -709,6 +880,17 @@ public Builder quantity(Double quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -720,6 +902,17 @@ public Builder item(PurchaseOrderLineItemRequestItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

    The purchase order line item's account.

    */ @@ -734,6 +927,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The purchase order line item's associated tracking category.

    */ @@ -748,6 +952,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

    The purchase order line item's associated tracking categories.

    */ @@ -776,6 +991,17 @@ public Builder taxAmount(String taxAmount) { return this; } + public Builder taxAmount(Nullable taxAmount) { + if (taxAmount.isNull()) { + this.taxAmount = null; + } else if (taxAmount.isEmpty()) { + this.taxAmount = Optional.empty(); + } else { + this.taxAmount = Optional.of(taxAmount.get()); + } + return this; + } + /** *

    The purchase order line item's total amount.

    */ @@ -790,6 +1016,17 @@ public Builder totalLineAmount(String totalLineAmount) { return this; } + public Builder totalLineAmount(Nullable totalLineAmount) { + if (totalLineAmount.isNull()) { + this.totalLineAmount = null; + } else if (totalLineAmount.isEmpty()) { + this.totalLineAmount = Optional.empty(); + } else { + this.totalLineAmount = Optional.of(totalLineAmount.get()); + } + return this; + } + /** *

    The purchase order line item's currency.

    *
      @@ -1112,6 +1349,17 @@ public Builder currency(PurchaseOrderLineItemRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

      The tax rate that applies to this line item.

      */ @@ -1126,6 +1374,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

      The purchase order line item's exchange rate.

      */ @@ -1140,6 +1399,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

      The company the purchase order line item belongs to.

      */ @@ -1154,6 +1424,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1165,6 +1446,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1176,6 +1468,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..0f9105ced 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrderRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -112,80 +115,110 @@ private PurchaseOrderRequest( *
    • DELETED - DELETED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The purchase order's issue date. */ - @JsonProperty("issue_date") + @JsonIgnore public Optional getIssueDate() { + if (issueDate == null) { + return Optional.empty(); + } return issueDate; } /** * @return The purchase order's delivery date. */ - @JsonProperty("delivery_date") + @JsonIgnore public Optional getDeliveryDate() { + if (deliveryDate == null) { + return Optional.empty(); + } return deliveryDate; } /** * @return The purchase order's delivery address. */ - @JsonProperty("delivery_address") + @JsonIgnore public Optional getDeliveryAddress() { + if (deliveryAddress == null) { + return Optional.empty(); + } return deliveryAddress; } /** * @return The contact making the purchase order. */ - @JsonProperty("customer") + @JsonIgnore public Optional getCustomer() { + if (customer == null) { + return Optional.empty(); + } return customer; } /** * @return The party fulfilling the purchase order. */ - @JsonProperty("vendor") + @JsonIgnore public Optional getVendor() { + if (vendor == null) { + return Optional.empty(); + } return vendor; } /** * @return A memo attached to the purchase order. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The company the purchase order belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The purchase order's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } /** * @return The payment term that applies to this transaction. */ - @JsonProperty("payment_term") + @JsonIgnore public Optional getPaymentTerm() { + if (paymentTerm == null) { + return Optional.empty(); + } return paymentTerm; } @@ -500,24 +533,33 @@ public Optional getPaymentTerm() { *
  • ZWL - Zimbabwean Dollar (2009)
  • * */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The purchase order's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } @@ -531,13 +573,19 @@ public Optional> getLineItems() { return lineItems; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -546,6 +594,96 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date") + private Optional _getIssueDate() { + return issueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("delivery_date") + private Optional _getDeliveryDate() { + return deliveryDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("delivery_address") + private Optional _getDeliveryAddress() { + return deliveryAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("customer") + private Optional _getCustomer() { + return customer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("vendor") + private Optional _getVendor() { + return vendor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_term") + private Optional _getPaymentTerm() { + return paymentTerm; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -697,6 +835,17 @@ public Builder status(PurchaseOrderRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

    The purchase order's issue date.

    */ @@ -711,6 +860,17 @@ public Builder issueDate(OffsetDateTime issueDate) { return this; } + public Builder issueDate(Nullable issueDate) { + if (issueDate.isNull()) { + this.issueDate = null; + } else if (issueDate.isEmpty()) { + this.issueDate = Optional.empty(); + } else { + this.issueDate = Optional.of(issueDate.get()); + } + return this; + } + /** *

    The purchase order's delivery date.

    */ @@ -725,6 +885,17 @@ public Builder deliveryDate(OffsetDateTime deliveryDate) { return this; } + public Builder deliveryDate(Nullable deliveryDate) { + if (deliveryDate.isNull()) { + this.deliveryDate = null; + } else if (deliveryDate.isEmpty()) { + this.deliveryDate = Optional.empty(); + } else { + this.deliveryDate = Optional.of(deliveryDate.get()); + } + return this; + } + /** *

    The purchase order's delivery address.

    */ @@ -739,6 +910,17 @@ public Builder deliveryAddress(PurchaseOrderRequestDeliveryAddress deliveryAddre return this; } + public Builder deliveryAddress(Nullable deliveryAddress) { + if (deliveryAddress.isNull()) { + this.deliveryAddress = null; + } else if (deliveryAddress.isEmpty()) { + this.deliveryAddress = Optional.empty(); + } else { + this.deliveryAddress = Optional.of(deliveryAddress.get()); + } + return this; + } + /** *

    The contact making the purchase order.

    */ @@ -753,6 +935,17 @@ public Builder customer(String customer) { return this; } + public Builder customer(Nullable customer) { + if (customer.isNull()) { + this.customer = null; + } else if (customer.isEmpty()) { + this.customer = Optional.empty(); + } else { + this.customer = Optional.of(customer.get()); + } + return this; + } + /** *

    The party fulfilling the purchase order.

    */ @@ -767,6 +960,17 @@ public Builder vendor(PurchaseOrderRequestVendor vendor) { return this; } + public Builder vendor(Nullable vendor) { + if (vendor.isNull()) { + this.vendor = null; + } else if (vendor.isEmpty()) { + this.vendor = Optional.empty(); + } else { + this.vendor = Optional.of(vendor.get()); + } + return this; + } + /** *

    A memo attached to the purchase order.

    */ @@ -781,6 +985,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

    The company the purchase order belongs to.

    */ @@ -795,6 +1010,17 @@ public Builder company(PurchaseOrderRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The purchase order's total amount.

    */ @@ -809,6 +1035,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

    The payment term that applies to this transaction.

    */ @@ -823,6 +1060,17 @@ public Builder paymentTerm(PurchaseOrderRequestPaymentTerm paymentTerm) { return this; } + public Builder paymentTerm(Nullable paymentTerm) { + if (paymentTerm.isNull()) { + this.paymentTerm = null; + } else if (paymentTerm.isEmpty()) { + this.paymentTerm = Optional.empty(); + } else { + this.paymentTerm = Optional.of(paymentTerm.get()); + } + return this; + } + /** *

    The purchase order's currency.

    *
      @@ -1145,6 +1393,17 @@ public Builder currency(PurchaseOrderRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

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

      */ @@ -1159,6 +1418,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

      The purchase order's exchange rate.

      */ @@ -1173,6 +1443,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1208,6 +1489,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1219,6 +1511,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..815c011d8 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersLineItemsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ 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..55f62ff73 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -51,11 +54,11 @@ public final class PurchaseOrdersListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -74,9 +77,9 @@ private PurchaseOrdersListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.companyId = companyId; @@ -173,16 +176,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("issue_date_after") + @JsonIgnore public Optional getIssueDateAfter() { + if (issueDateAfter == null) { + return Optional.empty(); + } return issueDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("issue_date_before") + @JsonIgnore public Optional getIssueDateBefore() { + if (issueDateBefore == null) { + return Optional.empty(); + } return issueDateBefore; } @@ -214,15 +223,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -230,10 +242,28 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date_after") + private Optional _getIssueDateAfter() { + return issueDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("issue_date_before") + private Optional _getIssueDateBefore() { + return issueDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -326,11 +356,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -503,6 +533,17 @@ public Builder issueDateAfter(OffsetDateTime issueDateAfter) { return this; } + public Builder issueDateAfter(Nullable issueDateAfter) { + if (issueDateAfter.isNull()) { + this.issueDateAfter = null; + } else if (issueDateAfter.isEmpty()) { + this.issueDateAfter = Optional.empty(); + } else { + this.issueDateAfter = Optional.of(issueDateAfter.get()); + } + return this; + } + /** *

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

      */ @@ -517,6 +558,17 @@ public Builder issueDateBefore(OffsetDateTime issueDateBefore) { return this; } + public Builder issueDateBefore(Nullable issueDateBefore) { + if (issueDateBefore.isNull()) { + this.issueDateBefore = null; + } else if (issueDateBefore.isEmpty()) { + this.issueDateBefore = Optional.empty(); + } else { + this.issueDateBefore = Optional.of(issueDateBefore.get()); + } + return this; + } + /** *

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

      */ @@ -563,12 +615,12 @@ public Builder pageSize(Integer pageSize) { *

      Deprecated. Use show_enum_origins.

      */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(PurchaseOrdersListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -587,16 +639,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(PurchaseOrdersListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestRemoteFields.java new file mode 100644 index 000000000..399f31047 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 PurchaseOrdersListRequestRemoteFields { + public static final PurchaseOrdersListRequestRemoteFields STATUS = + new PurchaseOrdersListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + PurchaseOrdersListRequestRemoteFields(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 PurchaseOrdersListRequestRemoteFields + && this.string.equals(((PurchaseOrdersListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PurchaseOrdersListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new PurchaseOrdersListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestShowEnumOrigins.java new file mode 100644 index 000000000..e4590a7a3 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 PurchaseOrdersListRequestShowEnumOrigins { + public static final PurchaseOrdersListRequestShowEnumOrigins STATUS = + new PurchaseOrdersListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + PurchaseOrdersListRequestShowEnumOrigins(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 PurchaseOrdersListRequestShowEnumOrigins + && this.string.equals(((PurchaseOrdersListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PurchaseOrdersListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new PurchaseOrdersListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..57e5019b2 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -90,16 +93,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -111,6 +120,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,6 +277,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -270,6 +302,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java index 8ad2a16f6..614734788 100644 --- a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequest.java @@ -30,9 +30,9 @@ public final class PurchaseOrdersRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -41,8 +41,8 @@ private PurchaseOrdersRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -89,7 +89,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -97,7 +97,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -151,9 +151,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -235,12 +235,12 @@ public Builder includeShellData(Boolean includeShellData) { *

      Deprecated. Use show_enum_origins.

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

      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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(PurchaseOrdersRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..19525c2bd --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 PurchaseOrdersRetrieveRequestRemoteFields { + public static final PurchaseOrdersRetrieveRequestRemoteFields STATUS = + new PurchaseOrdersRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + PurchaseOrdersRetrieveRequestRemoteFields(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 PurchaseOrdersRetrieveRequestRemoteFields + && this.string.equals(((PurchaseOrdersRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PurchaseOrdersRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new PurchaseOrdersRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..af48a2780 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/PurchaseOrdersRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 PurchaseOrdersRetrieveRequestShowEnumOrigins { + public static final PurchaseOrdersRetrieveRequestShowEnumOrigins STATUS = + new PurchaseOrdersRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + PurchaseOrdersRetrieveRequestShowEnumOrigins(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 PurchaseOrdersRetrieveRequestShowEnumOrigins + && this.string.equals(((PurchaseOrdersRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static PurchaseOrdersRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new PurchaseOrdersRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..05c4b33cd 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteField.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteF return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java b/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java index 8804c40f2..da75c9ac9 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); 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..d64d5a84a 100644 --- a/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java +++ b/src/main/java/com/merge/api/accounting/types/RemoteFieldRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); 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..d5e9673eb 100644 --- a/src/main/java/com/merge/api/accounting/types/ReportItem.java +++ b/src/main/java/com/merge/api/accounting/types/ReportItem.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -65,8 +68,11 @@ private ReportItem( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -89,16 +95,22 @@ public Optional getModifiedAt() { /** * @return The report item's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The report item's value. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -110,8 +122,11 @@ public Optional>> getSubItems() { /** * @return The company the report item belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -123,6 +138,30 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -216,6 +255,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -258,6 +308,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      The report item's value.

      */ @@ -272,6 +333,17 @@ public Builder value(Double value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @JsonSetter(value = "sub_items", nulls = Nulls.SKIP) public Builder subItems(Optional>> subItems) { this.subItems = subItems; @@ -297,6 +369,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

      */ diff --git a/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java index 044ac587c..eb332c738 100644 --- a/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/accounting/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/accounting/types/TaxComponent.java b/src/main/java/com/merge/api/accounting/types/TaxComponent.java index c5acb10a0..ab9cf1da0 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxComponent.java +++ b/src/main/java/com/merge/api/accounting/types/TaxComponent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -72,8 +75,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -96,24 +102,33 @@ public Optional getModifiedAt() { /** * @return The tax rate’s name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The tax component’s rate. */ - @JsonProperty("rate") + @JsonIgnore public Optional getRate() { + if (rate == null) { + return Optional.empty(); + } return rate; } /** * @return

      True if the tax component is compound, False if not.

      */ - @JsonProperty("is_compound") + @JsonIgnore public Optional getIsCompound() { + if (isCompound == null) { + return Optional.empty(); + } return isCompound; } @@ -124,8 +139,11 @@ public Optional getIsCompound() { *
    • PURCHASE - PURCHASE
    • *
    */ - @JsonProperty("component_type") + @JsonIgnore public Optional getComponentType() { + if (componentType == null) { + return Optional.empty(); + } return componentType; } @@ -137,6 +155,36 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rate") + private Optional _getRate() { + return rate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_compound") + private Optional _getIsCompound() { + return isCompound; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("component_type") + private Optional _getComponentType() { + return componentType; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -246,6 +294,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -288,6 +347,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The tax component’s rate.

    */ @@ -302,6 +372,17 @@ public Builder rate(String rate) { return this; } + public Builder rate(Nullable rate) { + if (rate.isNull()) { + this.rate = null; + } else if (rate.isEmpty()) { + this.rate = Optional.empty(); + } else { + this.rate = Optional.of(rate.get()); + } + return this; + } + /** *

    Returns True if the tax component is compound, False if not.

    */ @@ -316,6 +397,17 @@ public Builder isCompound(Boolean isCompound) { return this; } + public Builder isCompound(Nullable isCompound) { + if (isCompound.isNull()) { + this.isCompound = null; + } else if (isCompound.isEmpty()) { + this.isCompound = Optional.empty(); + } else { + this.isCompound = Optional.of(isCompound.get()); + } + return this; + } + /** *

    Returns PURCHASE if the tax component corresponds to a purchase tax or SALES if the tax component corresponds to a sales tax.

    *
      @@ -334,6 +426,17 @@ public Builder componentType(TaxComponentComponentType componentType) { return this; } + public Builder componentType(Nullable componentType) { + if (componentType.isNull()) { + this.componentType = null; + } else if (componentType.isEmpty()) { + this.componentType = Optional.empty(); + } else { + this.componentType = Optional.of(componentType.get()); + } + 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.

      */ 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..375c91f19 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRate.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRate.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,32 +132,44 @@ public Optional getModifiedAt() { /** * @return The subsidiary that the tax rate belongs to (in the case of multi-entity systems). */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The tax code associated with this tax rate or group of tax rates from the third-party platform. */ - @JsonProperty("code") + @JsonIgnore public Optional getCode() { + if (code == null) { + return Optional.empty(); + } return code; } /** * @return The tax rate’s name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The tax rate's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -162,32 +180,44 @@ public Optional getDescription() { *
    • ARCHIVED - ARCHIVED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The country the tax rate is associated with. */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } /** * @return The tax’s total tax rate - sum of the tax components (not compounded). */ - @JsonProperty("total_tax_rate") + @JsonIgnore public Optional getTotalTaxRate() { + if (totalTaxRate == null) { + return Optional.empty(); + } return totalTaxRate; } /** * @return The tax rate’s effective tax rate - total amount of tax with compounding. */ - @JsonProperty("effective_tax_rate") + @JsonIgnore public Optional getEffectiveTaxRate() { + if (effectiveTaxRate == null) { + return Optional.empty(); + } return effectiveTaxRate; } @@ -207,13 +237,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("code") + private Optional _getCode() { + return code; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_tax_rate") + private Optional _getTotalTaxRate() { + return totalTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("effective_tax_rate") + private Optional _getEffectiveTaxRate() { + return effectiveTaxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -361,6 +463,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -403,6 +516,17 @@ public Builder company(TaxRateCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The tax code associated with this tax rate or group of tax rates from the third-party platform.

    */ @@ -417,6 +541,17 @@ public Builder code(String code) { return this; } + public Builder code(Nullable code) { + if (code.isNull()) { + this.code = null; + } else if (code.isEmpty()) { + this.code = Optional.empty(); + } else { + this.code = Optional.of(code.get()); + } + return this; + } + /** *

    The tax rate’s name.

    */ @@ -431,6 +566,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The tax rate's description.

    */ @@ -445,6 +591,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The tax rate’s status - ACTIVE if an active tax rate, ARCHIVED if not active.

    *
      @@ -463,6 +620,17 @@ public Builder status(TaxRateStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The country the tax rate is associated with.

      */ @@ -477,6 +645,17 @@ public Builder country(String country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

      The tax’s total tax rate - sum of the tax components (not compounded).

      */ @@ -491,6 +670,17 @@ public Builder totalTaxRate(Double totalTaxRate) { return this; } + public Builder totalTaxRate(Nullable totalTaxRate) { + if (totalTaxRate.isNull()) { + this.totalTaxRate = null; + } else if (totalTaxRate.isEmpty()) { + this.totalTaxRate = Optional.empty(); + } else { + this.totalTaxRate = Optional.of(totalTaxRate.get()); + } + return this; + } + /** *

      The tax rate’s effective tax rate - total amount of tax with compounding.

      */ @@ -505,6 +695,17 @@ public Builder effectiveTaxRate(Double effectiveTaxRate) { return this; } + public Builder effectiveTaxRate(Nullable effectiveTaxRate) { + if (effectiveTaxRate.isNull()) { + this.effectiveTaxRate = null; + } else if (effectiveTaxRate.isEmpty()) { + this.effectiveTaxRate = Optional.empty(); + } else { + this.effectiveTaxRate = Optional.of(effectiveTaxRate.get()); + } + return this; + } + /** *

      The related tax components of the tax rate.

      */ @@ -544,6 +745,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -555,6 +767,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public TaxRate build() { return new TaxRate( id, 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..af02b3687 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TaxRatesListRequest.Builder.class) public final class TaxRatesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional companyId; @@ -52,7 +55,7 @@ public final class TaxRatesListRequest { private final Map additionalProperties; private TaxRatesListRequest( - Optional> expand, + Optional> expand, Optional companyId, Optional createdAfter, Optional createdBefore, @@ -86,7 +89,7 @@ private TaxRatesListRequest( * @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; } @@ -165,8 +168,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return TaxRates with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -181,8 +187,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -242,7 +263,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 companyId = Optional.empty(); @@ -294,17 +315,17 @@ public Builder from(TaxRatesListRequest 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(TaxRatesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -449,6 +470,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ @@ -477,6 +509,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TaxRatesListRequest build() { return new TaxRatesListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/TaxRatesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TaxRatesListRequestExpandItem.java new file mode 100644 index 000000000..61b47e268 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 TaxRatesListRequestExpandItem { + public static final TaxRatesListRequestExpandItem COMPANY = + new TaxRatesListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + TaxRatesListRequestExpandItem(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 TaxRatesListRequestExpandItem + && this.string.equals(((TaxRatesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TaxRatesListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new TaxRatesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java index d3c34015e..7899e4af8 100644 --- a/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TaxRatesRetrieveRequest.Builder.class) public final class TaxRatesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class TaxRatesRetrieveRequest { private final Map additionalProperties; private TaxRatesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private TaxRatesRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(TaxRatesRetrieveRequest 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(TaxRatesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..6df139a69 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TaxRatesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 TaxRatesRetrieveRequestExpandItem { + public static final TaxRatesRetrieveRequestExpandItem COMPANY = + new TaxRatesRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + TaxRatesRetrieveRequestExpandItem(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 TaxRatesRetrieveRequestExpandItem + && this.string.equals(((TaxRatesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TaxRatesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new TaxRatesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} 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..8c855b26b 100644 --- a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TrackingCategoriesListRequest.Builder.class) public final class TrackingCategoriesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional categoryType; @@ -49,18 +52,18 @@ public final class TrackingCategoriesListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional status; private final Map additionalProperties; private TrackingCategoriesListRequest( - Optional> expand, + Optional> expand, Optional categoryType, Optional companyId, Optional createdAfter, @@ -73,9 +76,9 @@ private TrackingCategoriesListRequest( Optional modifiedBefore, Optional name, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional status, Map additionalProperties) { this.expand = expand; @@ -102,15 +105,18 @@ private TrackingCategoriesListRequest( * @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; } /** * @return If provided, will only return tracking categories with this type. */ - @JsonProperty("category_type") + @JsonIgnore public Optional getCategoryType() { + if (categoryType == null) { + return Optional.empty(); + } return categoryType; } @@ -189,8 +195,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return tracking categories with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -206,15 +215,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -222,15 +234,42 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } /** * @return If provided, will only return tracking categories with this status. */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_type") + private Optional _getCategoryType() { + return categoryType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -298,7 +337,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 categoryType = Optional.empty(); @@ -324,11 +363,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional status = Optional.empty(); @@ -362,17 +401,17 @@ public Builder from(TrackingCategoriesListRequest 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(TrackingCategoriesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -391,6 +430,17 @@ public Builder categoryType(TrackingCategoriesListRequestCategoryType categoryTy return this; } + public Builder categoryType(Nullable categoryType) { + if (categoryType.isNull()) { + this.categoryType = null; + } else if (categoryType.isEmpty()) { + this.categoryType = Optional.empty(); + } else { + this.categoryType = Optional.of(categoryType.get()); + } + return this; + } + /** *

      If provided, will only return tracking categories for this company.

      */ @@ -531,6 +581,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ @@ -549,12 +610,12 @@ public Builder pageSize(Integer pageSize) { *

      Deprecated. Use show_enum_origins.

      */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(TrackingCategoriesListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -573,16 +634,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(TrackingCategoriesListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } @@ -601,6 +673,17 @@ public Builder status(TrackingCategoriesListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public TrackingCategoriesListRequest build() { return new TrackingCategoriesListRequest( expand, diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestExpandItem.java new file mode 100644 index 000000000..78108dfc0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesListRequestExpandItem { + public static final TrackingCategoriesListRequestExpandItem COMPANY = + new TrackingCategoriesListRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + TrackingCategoriesListRequestExpandItem(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 TrackingCategoriesListRequestExpandItem + && this.string.equals(((TrackingCategoriesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesListRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new TrackingCategoriesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestRemoteFields.java new file mode 100644 index 000000000..6eb27e9af --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesListRequestRemoteFields { + public static final TrackingCategoriesListRequestRemoteFields STATUS = + new TrackingCategoriesListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + TrackingCategoriesListRequestRemoteFields(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 TrackingCategoriesListRequestRemoteFields + && this.string.equals(((TrackingCategoriesListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new TrackingCategoriesListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..aeb43c7fa --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesListRequestShowEnumOrigins { + public static final TrackingCategoriesListRequestShowEnumOrigins STATUS = + new TrackingCategoriesListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + TrackingCategoriesListRequestShowEnumOrigins(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 TrackingCategoriesListRequestShowEnumOrigins + && this.string.equals(((TrackingCategoriesListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new TrackingCategoriesListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java index 5074a9189..46de35393 100644 --- a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequest.java @@ -22,24 +22,24 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TrackingCategoriesRetrieveRequest.Builder.class) public final class TrackingCategoriesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private TrackingCategoriesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -53,7 +53,7 @@ private TrackingCategoriesRetrieveRequest( * @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; } @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -125,15 +125,15 @@ 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(); private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -153,17 +153,17 @@ public Builder from(TrackingCategoriesRetrieveRequest 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(TrackingCategoriesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

      Deprecated. Use show_enum_origins.

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

      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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(TrackingCategoriesRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..eea10fa7e --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesRetrieveRequestExpandItem { + public static final TrackingCategoriesRetrieveRequestExpandItem COMPANY = + new TrackingCategoriesRetrieveRequestExpandItem(Value.COMPANY, "company"); + + private final Value value; + + private final String string; + + TrackingCategoriesRetrieveRequestExpandItem(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 TrackingCategoriesRetrieveRequestExpandItem + && this.string.equals(((TrackingCategoriesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPANY: + return visitor.visitCompany(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "company": + return COMPANY; + default: + return new TrackingCategoriesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + COMPANY, + + UNKNOWN + } + + public interface Visitor { + T visitCompany(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..3837255d0 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesRetrieveRequestRemoteFields { + public static final TrackingCategoriesRetrieveRequestRemoteFields STATUS = + new TrackingCategoriesRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + TrackingCategoriesRetrieveRequestRemoteFields(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 TrackingCategoriesRetrieveRequestRemoteFields + && this.string.equals(((TrackingCategoriesRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new TrackingCategoriesRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..da8b3e284 --- /dev/null +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategoriesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 TrackingCategoriesRetrieveRequestShowEnumOrigins { + public static final TrackingCategoriesRetrieveRequestShowEnumOrigins STATUS = + new TrackingCategoriesRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + TrackingCategoriesRetrieveRequestShowEnumOrigins(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 TrackingCategoriesRetrieveRequestShowEnumOrigins + && this.string.equals(((TrackingCategoriesRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TrackingCategoriesRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new TrackingCategoriesRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..a349185d2 100644 --- a/src/main/java/com/merge/api/accounting/types/TrackingCategory.java +++ b/src/main/java/com/merge/api/accounting/types/TrackingCategory.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -81,8 +84,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -105,8 +111,11 @@ public Optional getModifiedAt() { /** * @return The tracking category's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -117,8 +126,11 @@ public Optional getName() { *
    • ARCHIVED - ARCHIVED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -129,21 +141,30 @@ public Optional getStatus() { *
  • DEPARTMENT - DEPARTMENT
  • * */ - @JsonProperty("category_type") + @JsonIgnore public Optional getCategoryType() { + if (categoryType == null) { + return Optional.empty(); + } return categoryType; } - @JsonProperty("parent_category") + @JsonIgnore public Optional getParentCategory() { + if (parentCategory == null) { + return Optional.empty(); + } return parentCategory; } /** * @return The company the GeneralLedgerTransaction belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -155,8 +176,53 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_type") + private Optional _getCategoryType() { + return categoryType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_category") + private Optional _getParentCategory() { + return parentCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { return fieldMappings; } @@ -279,6 +345,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -321,6 +398,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The tracking category's status.

    *
      @@ -339,6 +427,17 @@ public Builder status(TrackingCategoryStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The tracking category’s type.

      *
        @@ -357,6 +456,17 @@ public Builder categoryType(TrackingCategoryCategoryType categoryType) { return this; } + public Builder categoryType(Nullable categoryType) { + if (categoryType.isNull()) { + this.categoryType = null; + } else if (categoryType.isEmpty()) { + this.categoryType = Optional.empty(); + } else { + this.categoryType = Optional.of(categoryType.get()); + } + return this; + } + @JsonSetter(value = "parent_category", nulls = Nulls.SKIP) public Builder parentCategory(Optional parentCategory) { this.parentCategory = parentCategory; @@ -368,6 +478,17 @@ public Builder parentCategory(String parentCategory) { return this; } + public Builder parentCategory(Nullable parentCategory) { + if (parentCategory.isNull()) { + this.parentCategory = null; + } else if (parentCategory.isEmpty()) { + this.parentCategory = Optional.empty(); + } else { + this.parentCategory = Optional.of(parentCategory.get()); + } + return this; + } + /** *

        The company the GeneralLedgerTransaction belongs to.

        */ @@ -382,6 +503,17 @@ public Builder company(TrackingCategoryCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

        */ @@ -407,6 +539,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + public TrackingCategory build() { return new TrackingCategory( id, 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..ea6c5c74b 100644 --- a/src/main/java/com/merge/api/accounting/types/Transaction.java +++ b/src/main/java/com/merge/api/accounting/types/Transaction.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -118,8 +121,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -142,56 +148,77 @@ public Optional getModifiedAt() { /** * @return The type of transaction, which can by any transaction object not already included in Merge’s common model. */ - @JsonProperty("transaction_type") + @JsonIgnore public Optional getTransactionType() { + if (transactionType == null) { + return Optional.empty(); + } return transactionType; } /** * @return The transaction's number used for identifying purposes. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The date upon which the transaction occurred. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The transaction's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact to whom the transaction relates to. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The total amount being paid after taxes. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -506,24 +533,33 @@ public Optional getTotalAmount() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The transaction's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the transaction belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -548,18 +584,111 @@ public Optional getRemoteWasDeleted() { /** * @return The accounting period that the Transaction was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_type") + private Optional _getTransactionType() { + return transactionType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -727,6 +856,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -769,6 +909,17 @@ public Builder transactionType(String transactionType) { return this; } + public Builder transactionType(Nullable transactionType) { + if (transactionType.isNull()) { + this.transactionType = null; + } else if (transactionType.isEmpty()) { + this.transactionType = Optional.empty(); + } else { + this.transactionType = Optional.of(transactionType.get()); + } + return this; + } + /** *

      The transaction's number used for identifying purposes.

      */ @@ -783,6 +934,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

      The date upon which the transaction occurred.

      */ @@ -797,6 +959,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      The transaction's account.

      */ @@ -811,6 +984,17 @@ public Builder account(TransactionAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The contact to whom the transaction relates to.

      */ @@ -825,6 +1009,17 @@ public Builder contact(TransactionContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

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

      */ @@ -839,6 +1034,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

      The total amount being paid after taxes.

      */ @@ -853,6 +1059,17 @@ public Builder totalAmount(String totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The transaction's currency.

      *
        @@ -1175,6 +1392,17 @@ public Builder currency(TransactionCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The transaction's exchange rate.

        */ @@ -1189,6 +1417,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The company the transaction belongs to.

        */ @@ -1203,6 +1442,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1254,6 +1504,17 @@ public Builder accountingPeriod(TransactionAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -1265,6 +1526,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1276,6 +1548,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Transaction build() { return new Transaction( id, diff --git a/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java b/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java index e5a7e71ef..70ccb9aea 100644 --- a/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionLineItem.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -105,8 +108,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -129,45 +135,63 @@ public Optional getModifiedAt() { /** * @return An internal note used by the business to clarify purpose of the transaction. */ - @JsonProperty("memo") + @JsonIgnore public Optional getMemo() { + if (memo == null) { + return Optional.empty(); + } return memo; } /** * @return The line item's unit price. */ - @JsonProperty("unit_price") + @JsonIgnore public Optional getUnitPrice() { + if (unitPrice == null) { + return Optional.empty(); + } return unitPrice; } /** * @return The line item's quantity. */ - @JsonProperty("quantity") + @JsonIgnore public Optional getQuantity() { + if (quantity == null) { + return Optional.empty(); + } return quantity; } - @JsonProperty("item") + @JsonIgnore public Optional getItem() { + if (item == null) { + return Optional.empty(); + } return item; } /** * @return The line item's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The line's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -182,16 +206,22 @@ public Optional>> getTrackingCategories() { /** * @return The line item's total. */ - @JsonProperty("total_line_amount") + @JsonIgnore public Optional getTotalLineAmount() { + if (totalLineAmount == null) { + return Optional.empty(); + } return totalLineAmount; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } @@ -506,24 +536,33 @@ public Optional getTaxRate() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return The company the line belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -535,6 +574,78 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("memo") + private Optional _getMemo() { + return memo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("unit_price") + private Optional _getUnitPrice() { + return unitPrice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("quantity") + private Optional _getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item") + private Optional _getItem() { + return item; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_line_amount") + private Optional _getTotalLineAmount() { + return totalLineAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -684,6 +795,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -726,6 +848,17 @@ public Builder memo(String memo) { return this; } + public Builder memo(Nullable memo) { + if (memo.isNull()) { + this.memo = null; + } else if (memo.isEmpty()) { + this.memo = Optional.empty(); + } else { + this.memo = Optional.of(memo.get()); + } + return this; + } + /** *

      The line item's unit price.

      */ @@ -740,6 +873,17 @@ public Builder unitPrice(String unitPrice) { return this; } + public Builder unitPrice(Nullable unitPrice) { + if (unitPrice.isNull()) { + this.unitPrice = null; + } else if (unitPrice.isEmpty()) { + this.unitPrice = Optional.empty(); + } else { + this.unitPrice = Optional.of(unitPrice.get()); + } + return this; + } + /** *

      The line item's quantity.

      */ @@ -754,6 +898,17 @@ public Builder quantity(String quantity) { return this; } + public Builder quantity(Nullable quantity) { + if (quantity.isNull()) { + this.quantity = null; + } else if (quantity.isEmpty()) { + this.quantity = Optional.empty(); + } else { + this.quantity = Optional.of(quantity.get()); + } + return this; + } + @JsonSetter(value = "item", nulls = Nulls.SKIP) public Builder item(Optional item) { this.item = item; @@ -765,6 +920,17 @@ public Builder item(TransactionLineItemItem item) { return this; } + public Builder item(Nullable item) { + if (item.isNull()) { + this.item = null; + } else if (item.isEmpty()) { + this.item = Optional.empty(); + } else { + this.item = Optional.of(item.get()); + } + return this; + } + /** *

      The line item's account.

      */ @@ -779,6 +945,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The line's associated tracking category.

      */ @@ -793,6 +970,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

      The transaction line item's associated tracking categories.

      */ @@ -821,6 +1009,17 @@ public Builder totalLineAmount(String totalLineAmount) { return this; } + public Builder totalLineAmount(Nullable totalLineAmount) { + if (totalLineAmount.isNull()) { + this.totalLineAmount = null; + } else if (totalLineAmount.isEmpty()) { + this.totalLineAmount = Optional.empty(); + } else { + this.totalLineAmount = Optional.of(totalLineAmount.get()); + } + return this; + } + /** *

      The tax rate that applies to this line item.

      */ @@ -835,6 +1034,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

      The line item's currency.

      *
        @@ -1157,6 +1367,17 @@ public Builder currency(TransactionLineItemCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The line item's exchange rate.

        */ @@ -1171,6 +1392,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

        The company the line belongs to.

        */ @@ -1185,6 +1417,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + 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.

        */ 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..3d1d02cfd 100644 --- a/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/TransactionsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -177,24 +180,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -480,6 +510,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

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

        */ @@ -494,6 +535,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

        */ @@ -508,6 +560,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public TransactionsListRequest build() { return new TransactionsListRequest( expand, 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..53a276b1d 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCredit.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCredit.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -114,8 +117,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -138,32 +144,44 @@ public Optional getModifiedAt() { /** * @return The vendor credit's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The vendor credit's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The vendor that owes the gift or refund. */ - @JsonProperty("vendor") + @JsonIgnore public Optional getVendor() { + if (vendor == null) { + return Optional.empty(); + } return vendor; } /** * @return The vendor credit's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -478,32 +496,44 @@ public Optional getTotalAmount() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The vendor credit's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The company the vendor credit belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -536,18 +566,99 @@ public Optional getRemoteWasDeleted() { /** * @return The accounting period that the VendorCredit was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("vendor") + private Optional _getVendor() { + return vendor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -710,6 +821,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -752,6 +874,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

      The vendor credit's transaction date.

      */ @@ -766,6 +899,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      The vendor that owes the gift or refund.

      */ @@ -780,6 +924,17 @@ public Builder vendor(VendorCreditVendor vendor) { return this; } + public Builder vendor(Nullable vendor) { + if (vendor.isNull()) { + this.vendor = null; + } else if (vendor.isEmpty()) { + this.vendor = Optional.empty(); + } else { + this.vendor = Optional.of(vendor.get()); + } + return this; + } + /** *

      The vendor credit's total amount.

      */ @@ -794,6 +949,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The vendor credit's currency.

      *
        @@ -1116,6 +1282,17 @@ public Builder currency(VendorCreditCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The vendor credit's exchange rate.

        */ @@ -1130,6 +1307,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

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

        */ @@ -1144,6 +1332,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

        The company the vendor credit belongs to.

        */ @@ -1158,6 +1357,17 @@ public Builder company(VendorCreditCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "lines", nulls = Nulls.SKIP) public Builder lines(Optional> lines) { this.lines = lines; @@ -1223,6 +1433,17 @@ public Builder accountingPeriod(VendorCreditAccountingPeriod accountingPeriod) { return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -1234,6 +1455,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1245,6 +1477,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public VendorCredit build() { return new VendorCredit( id, diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForInvoice.java b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForInvoice.java index f498806e8..81d9fd7e0 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForInvoice.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForInvoice.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -59,8 +62,11 @@ private VendorCreditApplyLineForInvoice( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -80,24 +86,33 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("vendor_credit") + @JsonIgnore public Optional getVendorCredit() { + if (vendorCredit == null) { + return Optional.empty(); + } return vendorCredit; } /** * @return Date that the vendor credit is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the VendorCredit applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } @@ -109,6 +124,30 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("vendor_credit") + private Optional _getVendorCredit() { + return vendorCredit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -197,6 +236,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -236,6 +286,17 @@ public Builder vendorCredit(VendorCreditApplyLineForInvoiceVendorCredit vendorCr return this; } + public Builder vendorCredit(Nullable vendorCredit) { + if (vendorCredit.isNull()) { + this.vendorCredit = null; + } else if (vendorCredit.isEmpty()) { + this.vendorCredit = Optional.empty(); + } else { + this.vendorCredit = Optional.of(vendorCredit.get()); + } + return this; + } + /** *

        Date that the vendor credit is applied to the invoice.

        */ @@ -250,6 +311,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the VendorCredit applied to the invoice.

        */ @@ -264,6 +336,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCredit.java b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCredit.java index 972776945..822cfec59 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCredit.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCredit.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -59,8 +62,11 @@ private VendorCreditApplyLineForVendorCredit( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -80,24 +86,33 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("invoice") + @JsonIgnore public Optional getInvoice() { + if (invoice == null) { + return Optional.empty(); + } return invoice; } /** * @return Date that the vendor credit is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the VendorCredit applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } @@ -109,6 +124,30 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("invoice") + private Optional _getInvoice() { + return invoice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -198,6 +237,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -237,6 +287,17 @@ public Builder invoice(VendorCreditApplyLineForVendorCreditInvoice invoice) { return this; } + public Builder invoice(Nullable invoice) { + if (invoice.isNull()) { + this.invoice = null; + } else if (invoice.isEmpty()) { + this.invoice = Optional.empty(); + } else { + this.invoice = Optional.of(invoice.get()); + } + return this; + } + /** *

        Date that the vendor credit is applied to the invoice.

        */ @@ -251,6 +312,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the VendorCredit applied to the invoice.

        */ @@ -265,6 +337,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java index 0e6b42900..211dbf1ae 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditApplyLineForVendorCreditRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -56,39 +59,93 @@ private VendorCreditApplyLineForVendorCreditRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } - @JsonProperty("invoice") + @JsonIgnore public Optional getInvoice() { + if (invoice == null) { + return Optional.empty(); + } return invoice; } /** * @return Date that the vendor credit is applied to the invoice. */ - @JsonProperty("applied_date") + @JsonIgnore public Optional getAppliedDate() { + if (appliedDate == null) { + return Optional.empty(); + } return appliedDate; } /** * @return The amount of the VendorCredit applied to the invoice. */ - @JsonProperty("applied_amount") + @JsonIgnore public Optional getAppliedAmount() { + if (appliedAmount == null) { + return Optional.empty(); + } return appliedAmount; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("invoice") + private Optional _getInvoice() { + return invoice; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_date") + private Optional _getAppliedDate() { + return appliedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_amount") + private Optional _getAppliedAmount() { + return appliedAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -176,6 +233,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + @JsonSetter(value = "invoice", nulls = Nulls.SKIP) public Builder invoice(Optional invoice) { this.invoice = invoice; @@ -187,6 +255,17 @@ public Builder invoice(VendorCreditApplyLineForVendorCreditRequestInvoice invoic return this; } + public Builder invoice(Nullable invoice) { + if (invoice.isNull()) { + this.invoice = null; + } else if (invoice.isEmpty()) { + this.invoice = Optional.empty(); + } else { + this.invoice = Optional.of(invoice.get()); + } + return this; + } + /** *

        Date that the vendor credit is applied to the invoice.

        */ @@ -201,6 +280,17 @@ public Builder appliedDate(OffsetDateTime appliedDate) { return this; } + public Builder appliedDate(Nullable appliedDate) { + if (appliedDate.isNull()) { + this.appliedDate = null; + } else if (appliedDate.isEmpty()) { + this.appliedDate = Optional.empty(); + } else { + this.appliedDate = Optional.of(appliedDate.get()); + } + return this; + } + /** *

        The amount of the VendorCredit applied to the invoice.

        */ @@ -215,6 +305,17 @@ public Builder appliedAmount(String appliedAmount) { return this; } + public Builder appliedAmount(Nullable appliedAmount) { + if (appliedAmount.isNull()) { + this.appliedAmount = null; + } else if (appliedAmount.isEmpty()) { + this.appliedAmount = Optional.empty(); + } else { + this.appliedAmount = Optional.of(appliedAmount.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -226,6 +327,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -237,6 +349,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public VendorCreditApplyLineForVendorCreditRequest build() { return new VendorCreditApplyLineForVendorCreditRequest( remoteId, diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java index 6e4fbad84..2d2da1d78 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLine.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -97,8 +100,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -121,16 +127,22 @@ public Optional getModifiedAt() { /** * @return The full value of the credit. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } /** * @return The line's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -145,50 +157,71 @@ public Optional>> getTrackingCategories() { /** * @return The line's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The company the line belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The vendor credit line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } @@ -200,6 +233,66 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -339,6 +432,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -381,6 +485,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + /** *

        The line's associated tracking category.

        */ @@ -395,6 +510,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The vendor credit line item's associated tracking categories.

        */ @@ -423,6 +549,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The line's account.

        */ @@ -437,6 +574,17 @@ public Builder account(VendorCreditLineAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The company the line belongs to.

        */ @@ -451,6 +599,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -462,6 +621,17 @@ public Builder project(VendorCreditLineProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + @JsonSetter(value = "contact", nulls = Nulls.SKIP) public Builder contact(Optional contact) { this.contact = contact; @@ -473,6 +643,17 @@ public Builder contact(VendorCreditLineContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -487,6 +668,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

        The vendor credit line item's exchange rate.

        */ @@ -501,6 +693,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + 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.

        */ diff --git a/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java index d1beb04ec..ac4f9cef1 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditLineRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -84,24 +87,33 @@ private VendorCreditLineRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return The full value of the credit. */ - @JsonProperty("net_amount") + @JsonIgnore public Optional getNetAmount() { + if (netAmount == null) { + return Optional.empty(); + } return netAmount; } /** * @return The line's associated tracking category. */ - @JsonProperty("tracking_category") + @JsonIgnore public Optional getTrackingCategory() { + if (trackingCategory == null) { + return Optional.empty(); + } return trackingCategory; } @@ -116,60 +128,159 @@ public Optional>> getTrackingCategories() { /** * @return The line's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The line's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The company the line belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } - @JsonProperty("project") + @JsonIgnore public Optional getProject() { + if (project == null) { + return Optional.empty(); + } return project; } - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The tax rate that applies to this line item. */ - @JsonProperty("tax_rate") + @JsonIgnore public Optional getTaxRate() { + if (taxRate == null) { + return Optional.empty(); + } return taxRate; } /** * @return The vendor credit line item's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_amount") + private Optional _getNetAmount() { + return netAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_category") + private Optional _getTrackingCategory() { + return trackingCategory; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("project") + private Optional _getProject() { + return project; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_rate") + private Optional _getTaxRate() { + return taxRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -291,6 +402,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The full value of the credit.

        */ @@ -305,6 +427,17 @@ public Builder netAmount(Double netAmount) { return this; } + public Builder netAmount(Nullable netAmount) { + if (netAmount.isNull()) { + this.netAmount = null; + } else if (netAmount.isEmpty()) { + this.netAmount = Optional.empty(); + } else { + this.netAmount = Optional.of(netAmount.get()); + } + return this; + } + /** *

        The line's associated tracking category.

        */ @@ -319,6 +452,17 @@ public Builder trackingCategory(String trackingCategory) { return this; } + public Builder trackingCategory(Nullable trackingCategory) { + if (trackingCategory.isNull()) { + this.trackingCategory = null; + } else if (trackingCategory.isEmpty()) { + this.trackingCategory = Optional.empty(); + } else { + this.trackingCategory = Optional.of(trackingCategory.get()); + } + return this; + } + /** *

        The vendor credit line item's associated tracking categories.

        */ @@ -347,6 +491,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The line's account.

        */ @@ -361,6 +516,17 @@ public Builder account(VendorCreditLineRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The company the line belongs to.

        */ @@ -375,6 +541,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "project", nulls = Nulls.SKIP) public Builder project(Optional project) { this.project = project; @@ -386,6 +563,17 @@ public Builder project(VendorCreditLineRequestProject project) { return this; } + public Builder project(Nullable project) { + if (project.isNull()) { + this.project = null; + } else if (project.isEmpty()) { + this.project = Optional.empty(); + } else { + this.project = Optional.of(project.get()); + } + return this; + } + @JsonSetter(value = "contact", nulls = Nulls.SKIP) public Builder contact(Optional contact) { this.contact = contact; @@ -397,6 +585,17 @@ public Builder contact(VendorCreditLineRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The tax rate that applies to this line item.

        */ @@ -411,6 +610,17 @@ public Builder taxRate(String taxRate) { return this; } + public Builder taxRate(Nullable taxRate) { + if (taxRate.isNull()) { + this.taxRate = null; + } else if (taxRate.isEmpty()) { + this.taxRate = Optional.empty(); + } else { + this.taxRate = Optional.of(taxRate.get()); + } + return this; + } + /** *

        The vendor credit line item's exchange rate.

        */ @@ -425,6 +635,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -436,6 +657,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -447,6 +679,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public VendorCreditLineRequest build() { return new VendorCreditLineRequest( remoteId, 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..ccaa6f138 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -85,32 +88,44 @@ private VendorCreditRequest( /** * @return The vendor credit's number. */ - @JsonProperty("number") + @JsonIgnore public Optional getNumber() { + if (number == null) { + return Optional.empty(); + } return number; } /** * @return The vendor credit's transaction date. */ - @JsonProperty("transaction_date") + @JsonIgnore public Optional getTransactionDate() { + if (transactionDate == null) { + return Optional.empty(); + } return transactionDate; } /** * @return The vendor that owes the gift or refund. */ - @JsonProperty("vendor") + @JsonIgnore public Optional getVendor() { + if (vendor == null) { + return Optional.empty(); + } return vendor; } /** * @return The vendor credit's total amount. */ - @JsonProperty("total_amount") + @JsonIgnore public Optional getTotalAmount() { + if (totalAmount == null) { + return Optional.empty(); + } return totalAmount; } @@ -425,32 +440,44 @@ public Optional getTotalAmount() { *
      • ZWL - Zimbabwean Dollar (2009)
      • *
      */ - @JsonProperty("currency") + @JsonIgnore public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } return currency; } /** * @return The vendor credit's exchange rate. */ - @JsonProperty("exchange_rate") + @JsonIgnore public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } return exchangeRate; } /** * @return If the transaction is inclusive or exclusive of tax. True if inclusive, False if exclusive. */ - @JsonProperty("inclusive_of_tax") + @JsonIgnore public Optional getInclusiveOfTax() { + if (inclusiveOfTax == null) { + return Optional.empty(); + } return inclusiveOfTax; } /** * @return The company the vendor credit belongs to. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } @@ -470,18 +497,93 @@ public Optional> getAppliedToL /** * @return The accounting period that the VendorCredit was generated in. */ - @JsonProperty("accounting_period") + @JsonIgnore public Optional getAccountingPeriod() { + if (accountingPeriod == null) { + return Optional.empty(); + } return accountingPeriod; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number") + private Optional _getNumber() { + return number; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date") + private Optional _getTransactionDate() { + return transactionDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("vendor") + private Optional _getVendor() { + return vendor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("total_amount") + private Optional _getTotalAmount() { + return totalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("inclusive_of_tax") + private Optional _getInclusiveOfTax() { + return inclusiveOfTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("accounting_period") + private Optional _getAccountingPeriod() { + return accountingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -604,6 +706,17 @@ public Builder number(String number) { return this; } + public Builder number(Nullable number) { + if (number.isNull()) { + this.number = null; + } else if (number.isEmpty()) { + this.number = Optional.empty(); + } else { + this.number = Optional.of(number.get()); + } + return this; + } + /** *

      The vendor credit's transaction date.

      */ @@ -618,6 +731,17 @@ public Builder transactionDate(OffsetDateTime transactionDate) { return this; } + public Builder transactionDate(Nullable transactionDate) { + if (transactionDate.isNull()) { + this.transactionDate = null; + } else if (transactionDate.isEmpty()) { + this.transactionDate = Optional.empty(); + } else { + this.transactionDate = Optional.of(transactionDate.get()); + } + return this; + } + /** *

      The vendor that owes the gift or refund.

      */ @@ -632,6 +756,17 @@ public Builder vendor(VendorCreditRequestVendor vendor) { return this; } + public Builder vendor(Nullable vendor) { + if (vendor.isNull()) { + this.vendor = null; + } else if (vendor.isEmpty()) { + this.vendor = Optional.empty(); + } else { + this.vendor = Optional.of(vendor.get()); + } + return this; + } + /** *

      The vendor credit's total amount.

      */ @@ -646,6 +781,17 @@ public Builder totalAmount(Double totalAmount) { return this; } + public Builder totalAmount(Nullable totalAmount) { + if (totalAmount.isNull()) { + this.totalAmount = null; + } else if (totalAmount.isEmpty()) { + this.totalAmount = Optional.empty(); + } else { + this.totalAmount = Optional.of(totalAmount.get()); + } + return this; + } + /** *

      The vendor credit's currency.

      *
        @@ -968,6 +1114,17 @@ public Builder currency(VendorCreditRequestCurrency currency) { return this; } + public Builder currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + /** *

        The vendor credit's exchange rate.

        */ @@ -982,6 +1139,17 @@ public Builder exchangeRate(String exchangeRate) { return this; } + public Builder exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + /** *

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

        */ @@ -996,6 +1164,17 @@ public Builder inclusiveOfTax(Boolean inclusiveOfTax) { return this; } + public Builder inclusiveOfTax(Nullable inclusiveOfTax) { + if (inclusiveOfTax.isNull()) { + this.inclusiveOfTax = null; + } else if (inclusiveOfTax.isEmpty()) { + this.inclusiveOfTax = Optional.empty(); + } else { + this.inclusiveOfTax = Optional.of(inclusiveOfTax.get()); + } + return this; + } + /** *

        The company the vendor credit belongs to.

        */ @@ -1010,6 +1189,17 @@ public Builder company(VendorCreditRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + @JsonSetter(value = "tracking_categories", nulls = Nulls.SKIP) public Builder trackingCategories( Optional>> trackingCategories) { @@ -1051,6 +1241,17 @@ public Builder accountingPeriod(VendorCreditRequestAccountingPeriod accountingPe return this; } + public Builder accountingPeriod(Nullable accountingPeriod) { + if (accountingPeriod.isNull()) { + this.accountingPeriod = null; + } else if (accountingPeriod.isEmpty()) { + this.accountingPeriod = Optional.empty(); + } else { + this.accountingPeriod = Optional.of(accountingPeriod.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -1062,6 +1263,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1073,6 +1285,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public VendorCreditRequest build() { return new VendorCreditRequest( number, 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..5060ea0bb 100644 --- a/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java +++ b/src/main/java/com/merge/api/accounting/types/VendorCreditsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -177,24 +180,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return objects created after this datetime. */ - @JsonProperty("transaction_date_after") + @JsonIgnore public Optional getTransactionDateAfter() { + if (transactionDateAfter == null) { + return Optional.empty(); + } return transactionDateAfter; } /** * @return If provided, will only return objects created before this datetime. */ - @JsonProperty("transaction_date_before") + @JsonIgnore public Optional getTransactionDateBefore() { + if (transactionDateBefore == null) { + return Optional.empty(); + } + return transactionDateBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_after") + private Optional _getTransactionDateAfter() { + return transactionDateAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transaction_date_before") + private Optional _getTransactionDateBefore() { return transactionDateBefore; } @@ -480,6 +510,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

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

        */ @@ -494,6 +535,17 @@ public Builder transactionDateAfter(OffsetDateTime transactionDateAfter) { return this; } + public Builder transactionDateAfter(Nullable transactionDateAfter) { + if (transactionDateAfter.isNull()) { + this.transactionDateAfter = null; + } else if (transactionDateAfter.isEmpty()) { + this.transactionDateAfter = Optional.empty(); + } else { + this.transactionDateAfter = Optional.of(transactionDateAfter.get()); + } + return this; + } + /** *

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

        */ @@ -508,6 +560,17 @@ public Builder transactionDateBefore(OffsetDateTime transactionDateBefore) { return this; } + public Builder transactionDateBefore(Nullable transactionDateBefore) { + if (transactionDateBefore.isNull()) { + this.transactionDateBefore = null; + } else if (transactionDateBefore.isEmpty()) { + this.transactionDateBefore = Optional.empty(); + } else { + this.transactionDateBefore = Optional.of(transactionDateBefore.get()); + } + return this; + } + public VendorCreditsListRequest build() { return new VendorCreditsListRequest( expand, diff --git a/src/main/java/com/merge/api/ats/AccountTokenClient.java b/src/main/java/com/merge/api/ats/AccountTokenClient.java index 6a4214805..e9bb309d1 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.AccountTokenRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, 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..a3761b5a7 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.AccountTokenRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import java.util.concurrent.CompletableFuture; @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java index f43c40863..1f8988a6f 100644 --- a/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/AsyncAsyncPassthroughClient.java @@ -4,6 +4,7 @@ package com.merge.api.ats; import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ats.types.DataPassthroughRequest; import com.merge.api.core.ClientOptions; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java b/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java index f76462148..506758b6c 100644 --- a/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncCandidatesClient.java @@ -6,9 +6,10 @@ import com.merge.api.ats.types.Candidate; import com.merge.api.ats.types.CandidateEndpointRequest; import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesIgnoreCreateRequest; import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesMetaPatchRetrieveRequest; import com.merge.api.ats.types.CandidatesRetrieveRequest; -import com.merge.api.ats.types.IgnoreCommonModelRequest; import com.merge.api.ats.types.MetaResponse; import com.merge.api.ats.types.PatchedCandidateEndpointRequest; import com.merge.api.core.ClientOptions; @@ -110,7 +111,7 @@ public CompletableFuture partialUpdate( /** * 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. */ - public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public CompletableFuture ignoreCreate(String modelId, CandidatesIgnoreCreateRequest request) { return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); } @@ -118,7 +119,7 @@ public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelReq * 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. */ public CompletableFuture ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, CandidatesIgnoreCreateRequest request, RequestOptions requestOptions) { return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); } @@ -132,8 +133,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Candidate PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, CandidatesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, CandidatesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java index 069ad5597..e7e98f99a 100644 --- a/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/AsyncFieldMappingClient.java @@ -7,6 +7,7 @@ import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsDestroyRequest; import com.merge.api.ats.types.FieldMappingsRetrieveRequest; import com.merge.api.ats.types.PatchedEditFieldMappingRequest; import com.merge.api.ats.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/ats/AsyncIssuesClient.java b/src/main/java/com/merge/api/ats/AsyncIssuesClient.java index aca9ca991..fd900eb68 100644 --- a/src/main/java/com/merge/api/ats/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.ats.types.Issue; import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.IssuesRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..af9731d25 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.AccountTokenRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..8dad70b3e 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawActivitiesClient.java @@ -21,10 +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; import okhttp3.Call; @@ -144,10 +141,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedActivityList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() .from(request) .cursor(startingAfter) @@ -155,7 +153,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -167,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)); @@ -210,13 +205,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 +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(), 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 +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(), 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 +366,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..284263955 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawApplicationsClient.java @@ -23,10 +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; import okhttp3.Call; @@ -159,10 +156,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedApplicationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedApplicationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() .from(request) .cursor(startingAfter) @@ -170,7 +168,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -182,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)); @@ -229,13 +224,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 +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(), 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 +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(), 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 +381,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 +404,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 +473,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..268bf6b35 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAsyncPassthroughClient.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ats.types.DataPassthroughRequest; import com.merge.api.core.ApiError; @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..ab0674b87 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAttachmentsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -145,10 +142,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -156,7 +154,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -168,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,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); } @@ -237,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(), 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 +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(), 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 +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/AsyncRawAuditTrailClient.java b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java index 6d26ba9db..3da3aeab5 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..73c68eca8 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawCandidatesClient.java @@ -7,9 +7,10 @@ import com.merge.api.ats.types.Candidate; import com.merge.api.ats.types.CandidateEndpointRequest; import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesIgnoreCreateRequest; import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesMetaPatchRetrieveRequest; import com.merge.api.ats.types.CandidatesRetrieveRequest; -import com.merge.api.ats.types.IgnoreCommonModelRequest; import com.merge.api.ats.types.MetaResponse; import com.merge.api.ats.types.PaginatedCandidateList; import com.merge.api.ats.types.PatchedCandidateEndpointRequest; @@ -24,10 +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; import okhttp3.Call; @@ -151,10 +149,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCandidateList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCandidateList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CandidatesListRequest nextRequest = CandidatesListRequest.builder() .from(request) .cursor(startingAfter) @@ -162,7 +161,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -428,7 +412,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request) { + String modelId, CandidatesIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -436,7 +420,7 @@ public CompletableFuture> ignoreCreate( * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, CandidatesIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/candidates/ignore") @@ -445,7 +429,7 @@ public CompletableFuture> ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize 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)); @@ -492,25 +474,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Candidate PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, CandidatesMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Candidate PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, CandidatesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, CandidatesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/candidates/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -520,18 +511,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 +564,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..95a6e3d7d 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawDepartmentsClient.java @@ -18,7 +18,6 @@ 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; @@ -122,10 +121,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedDepartmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDepartmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DepartmentsListRequest nextRequest = DepartmentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -133,7 +133,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -145,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)); @@ -214,18 +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(), 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..7b82cb2b5 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawEeocsClient.java @@ -18,7 +18,6 @@ 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; @@ -137,17 +136,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEeocList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EeocsListRequest nextRequest = EeocsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -159,12 +159,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 +237,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..39ec39785 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawFieldMappingClient.java @@ -8,6 +8,7 @@ import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsDestroyRequest; import com.merge.api.ats.types.FieldMappingsRetrieveRequest; import com.merge.api.ats.types.PatchedEditFieldMappingRequest; import com.merge.api.ats.types.RemoteFieldApiResponse; @@ -21,8 +22,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 +86,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 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -304,19 +299,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 +373,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 +428,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..432ed7094 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawInterviewsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -161,10 +158,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedScheduledInterviewList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InterviewsListRequest nextRequest = InterviewsListRequest.builder() .from(request) .cursor(startingAfter) @@ -173,7 +171,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -185,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)); @@ -229,13 +224,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 +247,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 +334,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 +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)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java index cf29392f7..10c8a76a4 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.ats.types.Issue; import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.IssuesRetrieveRequest; import com.merge.api.ats.types.PaginatedIssueList; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -17,7 +18,6 @@ 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; @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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..738e14bb2 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobInterviewStagesClient.java @@ -18,7 +18,6 @@ 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; @@ -131,10 +130,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedJobInterviewStageList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() .from(request) .cursor(startingAfter) @@ -143,7 +143,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -155,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)); @@ -229,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(), 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..a91af4d2c 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobPostingsClient.java @@ -18,7 +18,6 @@ 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; @@ -130,10 +129,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedJobPostingList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobPostingList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobPostingsListRequest nextRequest = JobPostingsListRequest.builder() .from(request) .cursor(startingAfter) @@ -141,7 +141,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -153,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)); @@ -226,18 +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(), 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..a529de6c3 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawJobsClient.java @@ -21,7 +21,6 @@ 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; @@ -148,17 +147,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobsListRequest nextRequest = JobsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -170,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)); @@ -251,17 +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(), 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,10 +344,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedScreeningQuestionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -361,7 +357,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return screeningQuestionsList(jobId, nextRequest, requestOptions) .get() @@ -373,12 +369,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..2e82b74eb 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkTokenClient.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(), 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..8f67777a7 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -138,10 +137,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); diff --git a/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java index a558e70e0..3f97eea4e 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawOffersClient.java @@ -18,7 +18,6 @@ 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; @@ -141,17 +140,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfferList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OffersListRequest nextRequest = OffersListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -163,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)); @@ -244,17 +241,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..bc6bb7011 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawOfficesClient.java @@ -18,7 +18,6 @@ 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; @@ -121,35 +120,32 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfficeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OfficesListRequest nextRequest = OfficesListRequest.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); - } - }), + new SyncPagingIterable(!startingAfter.isEmpty(), 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)); @@ -213,17 +209,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..61a1abe7a 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawRejectReasonsClient.java @@ -18,7 +18,6 @@ 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; @@ -122,10 +121,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRejectReasonList.class); + String startingAfter = parsedResponse.getNext().orElse(null); RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() .from(request) .cursor(startingAfter) @@ -133,7 +133,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -145,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)); @@ -215,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(), 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..5448e56dd 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawScorecardsClient.java @@ -18,7 +18,6 @@ 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; @@ -145,10 +144,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedScorecardList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScorecardList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() .from(request) .cursor(startingAfter) @@ -156,7 +156,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -168,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)); @@ -249,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(), 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..0bdb17141 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -82,10 +81,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) .cursor(startingAfter) @@ -93,7 +93,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -105,12 +105,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..d7a064315 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawTagsClient.java @@ -17,7 +17,6 @@ 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; @@ -120,17 +119,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -142,12 +142,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..1a498b12c 100644 --- a/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/ats/AsyncRawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -133,10 +132,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedRemoteUserList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); UsersListRequest nextRequest = UsersListRequest.builder() .from(request) .cursor(startingAfter) @@ -144,7 +144,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -156,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)); @@ -233,18 +230,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/CandidatesClient.java b/src/main/java/com/merge/api/ats/CandidatesClient.java index 85fbb9df7..3bc840ad5 100644 --- a/src/main/java/com/merge/api/ats/CandidatesClient.java +++ b/src/main/java/com/merge/api/ats/CandidatesClient.java @@ -6,9 +6,10 @@ import com.merge.api.ats.types.Candidate; import com.merge.api.ats.types.CandidateEndpointRequest; import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesIgnoreCreateRequest; import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesMetaPatchRetrieveRequest; import com.merge.api.ats.types.CandidatesRetrieveRequest; -import com.merge.api.ats.types.IgnoreCommonModelRequest; import com.merge.api.ats.types.MetaResponse; import com.merge.api.ats.types.PatchedCandidateEndpointRequest; import com.merge.api.core.ClientOptions; @@ -106,14 +107,14 @@ public CandidateResponse partialUpdate( /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public void ignoreCreate(String modelId, CandidatesIgnoreCreateRequest request) { this.rawClient.ignoreCreate(modelId, request).body(); } /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + public void ignoreCreate(String modelId, CandidatesIgnoreCreateRequest request, RequestOptions requestOptions) { this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); } @@ -127,8 +128,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Candidate PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, CandidatesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, CandidatesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/ats/FieldMappingClient.java b/src/main/java/com/merge/api/ats/FieldMappingClient.java index 05fab54c8..48cb3b627 100644 --- a/src/main/java/com/merge/api/ats/FieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/FieldMappingClient.java @@ -7,6 +7,7 @@ import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsDestroyRequest; import com.merge.api.ats.types.FieldMappingsRetrieveRequest; import com.merge.api.ats.types.PatchedEditFieldMappingRequest; import com.merge.api.ats.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/ats/IssuesClient.java b/src/main/java/com/merge/api/ats/IssuesClient.java index d5f428383..a70560a6f 100644 --- a/src/main/java/com/merge/api/ats/IssuesClient.java +++ b/src/main/java/com/merge/api/ats/IssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.ats.types.Issue; import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.IssuesRetrieveRequest; import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..d9c4d25af 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.AccountTokenRetrieveRequest; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; import com.merge.api.core.MergeApiHttpResponse; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..72097ae24 100644 --- a/src/main/java/com/merge/api/ats/RawActivitiesClient.java +++ b/src/main/java/com/merge/api/ats/RawActivitiesClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -136,27 +133,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedActivityList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ActivitiesListRequest nextRequest = ActivitiesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -185,13 +179,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 +199,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 +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(), 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 +308,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..320f7525c 100644 --- a/src/main/java/com/merge/api/ats/RawApplicationsClient.java +++ b/src/main/java/com/merge/api/ats/RawApplicationsClient.java @@ -23,10 +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; import okhttp3.OkHttpClient; @@ -150,10 +147,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedApplicationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ApplicationsListRequest nextRequest = ApplicationsListRequest.builder() .from(request) .cursor(startingAfter) @@ -161,17 +159,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -204,13 +198,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 +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(), 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 +280,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 +325,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 +345,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 +398,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..69b556d0b 100644 --- a/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ats/RawAsyncPassthroughClient.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.merge.api.ats.types.AsyncPassthroughReciept; +import com.merge.api.ats.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ats.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ats.types.DataPassthroughRequest; import com.merge.api.core.ApiError; @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..ebf353426 100644 --- a/src/main/java/com/merge/api/ats/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ats/RawAttachmentsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -136,28 +133,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -186,13 +179,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 +199,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 +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(), 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 +308,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..3d1badce6 100644 --- a/src/main/java/com/merge/api/ats/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ats/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..a76dc43c5 100644 --- a/src/main/java/com/merge/api/ats/RawCandidatesClient.java +++ b/src/main/java/com/merge/api/ats/RawCandidatesClient.java @@ -7,9 +7,10 @@ import com.merge.api.ats.types.Candidate; import com.merge.api.ats.types.CandidateEndpointRequest; import com.merge.api.ats.types.CandidateResponse; +import com.merge.api.ats.types.CandidatesIgnoreCreateRequest; import com.merge.api.ats.types.CandidatesListRequest; +import com.merge.api.ats.types.CandidatesMetaPatchRetrieveRequest; import com.merge.api.ats.types.CandidatesRetrieveRequest; -import com.merge.api.ats.types.IgnoreCommonModelRequest; import com.merge.api.ats.types.MetaResponse; import com.merge.api.ats.types.PaginatedCandidateList; import com.merge.api.ats.types.PatchedCandidateEndpointRequest; @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -143,27 +141,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCandidateList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CandidatesListRequest nextRequest = CandidatesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -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); } @@ -360,7 +340,7 @@ public MergeApiHttpResponse partialUpdate( /** * 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. */ - public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public MergeApiHttpResponse ignoreCreate(String modelId, CandidatesIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -368,7 +348,7 @@ public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModel * 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. */ public MergeApiHttpResponse ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, CandidatesIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/candidates/ignore") @@ -377,7 +357,7 @@ public MergeApiHttpResponse ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize 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); } @@ -411,40 +388,46 @@ public MergeApiHttpResponse ignoreCreate( * Returns metadata for Candidate PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, CandidatesMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Candidate PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, CandidatesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Candidate PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, CandidatesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/candidates/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +460,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..173001437 100644 --- a/src/main/java/com/merge/api/ats/RawDepartmentsClient.java +++ b/src/main/java/com/merge/api/ats/RawDepartmentsClient.java @@ -18,7 +18,6 @@ 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; @@ -113,28 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDepartmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DepartmentsListRequest nextRequest = DepartmentsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -186,16 +181,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..80c95ba57 100644 --- a/src/main/java/com/merge/api/ats/RawEeocsClient.java +++ b/src/main/java/com/merge/api/ats/RawEeocsClient.java @@ -18,7 +18,6 @@ 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; @@ -129,27 +128,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEeocList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EeocsListRequest nextRequest = EeocsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -212,16 +208,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..8a8f184a6 100644 --- a/src/main/java/com/merge/api/ats/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ats/RawFieldMappingClient.java @@ -8,6 +8,7 @@ import com.merge.api.ats.types.ExternalTargetFieldApiResponse; import com.merge.api.ats.types.FieldMappingApiInstanceResponse; import com.merge.api.ats.types.FieldMappingInstanceResponse; +import com.merge.api.ats.types.FieldMappingsDestroyRequest; import com.merge.api.ats.types.FieldMappingsRetrieveRequest; import com.merge.api.ats.types.PatchedEditFieldMappingRequest; import com.merge.api.ats.types.RemoteFieldApiResponse; @@ -21,8 +22,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 +79,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 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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 +302,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 +342,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..40087ce2f 100644 --- a/src/main/java/com/merge/api/ats/RawInterviewsClient.java +++ b/src/main/java/com/merge/api/ats/RawInterviewsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -151,10 +148,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedScheduledInterviewList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScheduledInterviewList.class); + String startingAfter = parsedResponse.getNext().orElse(null); InterviewsListRequest nextRequest = InterviewsListRequest.builder() .from(request) .cursor(startingAfter) @@ -162,17 +160,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -201,13 +195,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 +215,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 +286,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 +325,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..b8d12b184 100644 --- a/src/main/java/com/merge/api/ats/RawIssuesClient.java +++ b/src/main/java/com/merge/api/ats/RawIssuesClient.java @@ -5,6 +5,7 @@ import com.merge.api.ats.types.Issue; import com.merge.api.ats.types.IssuesListRequest; +import com.merge.api.ats.types.IssuesRetrieveRequest; import com.merge.api.ats.types.PaginatedIssueList; import com.merge.api.core.ApiError; import com.merge.api.core.ClientOptions; @@ -17,7 +18,6 @@ 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; @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ats/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..75848a795 100644 --- a/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java +++ b/src/main/java/com/merge/api/ats/RawJobInterviewStagesClient.java @@ -18,7 +18,6 @@ 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; @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedJobInterviewStageList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobInterviewStageList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobInterviewStagesListRequest nextRequest = JobInterviewStagesListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,17 +132,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -198,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(), 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..c0c42985c 100644 --- a/src/main/java/com/merge/api/ats/RawJobPostingsClient.java +++ b/src/main/java/com/merge/api/ats/RawJobPostingsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,28 +120,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobPostingList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobPostingsListRequest nextRequest = JobPostingsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -198,16 +193,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..d51642f42 100644 --- a/src/main/java/com/merge/api/ats/RawJobsClient.java +++ b/src/main/java/com/merge/api/ats/RawJobsClient.java @@ -21,7 +21,6 @@ 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; @@ -139,27 +138,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedJobList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobsListRequest nextRequest = JobsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -222,16 +218,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,10 +298,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedScreeningQuestionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScreeningQuestionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); JobsScreeningQuestionsListRequest nextRequest = JobsScreeningQuestionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -316,17 +310,13 @@ public MergeApiHttpResponse> screeningQues List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> screeningQuestionsList( + !startingAfter.isEmpty(), result, parsedResponse, () -> screeningQuestionsList( jobId, 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/ats/RawLinkTokenClient.java b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java index fee541b98..8d61c068f 100644 --- a/src/main/java/com/merge/api/ats/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ats/RawLinkTokenClient.java @@ -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..bf79c3cff 100644 --- a/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ats/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/ats/RawOffersClient.java b/src/main/java/com/merge/api/ats/RawOffersClient.java index 4e5777f10..d074d1af3 100644 --- a/src/main/java/com/merge/api/ats/RawOffersClient.java +++ b/src/main/java/com/merge/api/ats/RawOffersClient.java @@ -18,7 +18,6 @@ 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; @@ -133,27 +132,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfferList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OffersListRequest nextRequest = OffersListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -217,16 +213,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..0a16a55cd 100644 --- a/src/main/java/com/merge/api/ats/RawOfficesClient.java +++ b/src/main/java/com/merge/api/ats/RawOfficesClient.java @@ -18,7 +18,6 @@ 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; @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOfficeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OfficesListRequest nextRequest = OfficesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -185,16 +181,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..807faf5d1 100644 --- a/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java +++ b/src/main/java/com/merge/api/ats/RawRejectReasonsClient.java @@ -18,7 +18,6 @@ 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; @@ -113,10 +112,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRejectReasonList.class); + String startingAfter = parsedResponse.getNext().orElse(null); RejectReasonsListRequest nextRequest = RejectReasonsListRequest.builder() .from(request) .cursor(startingAfter) @@ -124,17 +124,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -186,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(), 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..69c355284 100644 --- a/src/main/java/com/merge/api/ats/RawScorecardsClient.java +++ b/src/main/java/com/merge/api/ats/RawScorecardsClient.java @@ -18,7 +18,6 @@ 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; @@ -137,27 +136,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedScorecardList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ScorecardsListRequest nextRequest = ScorecardsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -221,16 +217,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..7d6ff9079 100644 --- a/src/main/java/com/merge/api/ats/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ats/RawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -74,28 +73,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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/ats/RawTagsClient.java b/src/main/java/com/merge/api/ats/RawTagsClient.java index 0aeb7bda1..9bb693b3d 100644 --- a/src/main/java/com/merge/api/ats/RawTagsClient.java +++ b/src/main/java/com/merge/api/ats/RawTagsClient.java @@ -17,7 +17,6 @@ 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; @@ -111,27 +110,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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/ats/RawUsersClient.java b/src/main/java/com/merge/api/ats/RawUsersClient.java index 19b0f7a85..11b981fcc 100644 --- a/src/main/java/com/merge/api/ats/RawUsersClient.java +++ b/src/main/java/com/merge/api/ats/RawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -125,28 +124,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -206,16 +201,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..549aa2a96 100644 --- a/src/main/java/com/merge/api/ats/types/AccountDetails.java +++ b/src/main/java/com/merge/api/ats/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(AccountDetailsCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..d9504196e 100644 --- a/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/ats/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ats/types/AccountIntegration.java b/src/main/java/com/merge/api/ats/types/AccountIntegration.java index c5526ffa6..903ea1205 100644 --- a/src/main/java/com/merge/api/ats/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/ats/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

        Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

        */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

        Company logo in square shape.

        */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

        The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

        */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

        Category or categories this integration is in beta status for.

        */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

        Company logo in square shape.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

        Company logo in rectangular shape.

        * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ats/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..73f029cb5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(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..0d9e5ba72 100644 --- a/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ActivitiesListRequest.Builder.class) public final class ActivitiesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -54,7 +57,7 @@ public final class ActivitiesListRequest { private final Map additionalProperties; private ActivitiesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -90,7 +93,7 @@ private ActivitiesListRequest( * @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; } @@ -177,8 +180,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -198,6 +204,12 @@ public Optional getUserId() { return userId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,7 +268,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 createdAfter = Optional.empty(); @@ -311,17 +323,17 @@ public Builder from(ActivitiesListRequest 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(ActivitiesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -480,6 +492,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

        */ diff --git a/src/main/java/com/merge/api/ats/types/ActivitiesListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestExpandItem.java new file mode 100644 index 000000000..81a082978 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ActivitiesListRequestExpandItem.java @@ -0,0 +1,74 @@ +/** + * 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 ActivitiesListRequestExpandItem { + public static final ActivitiesListRequestExpandItem USER = new ActivitiesListRequestExpandItem(Value.USER, "user"); + + private final Value value; + + private final String string; + + ActivitiesListRequestExpandItem(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 ActivitiesListRequestExpandItem + && this.string.equals(((ActivitiesListRequestExpandItem) 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 UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActivitiesListRequestExpandItem valueOf(String value) { + switch (value) { + case "user": + return USER; + default: + return new ActivitiesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + USER, + + UNKNOWN + } + + public interface Visitor { + T visitUser(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java index 9ef3ab2d4..76a9971d3 100644 --- a/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ActivitiesRetrieveRequest.Builder.class) public final class ActivitiesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -35,7 +35,7 @@ public final class ActivitiesRetrieveRequest { private final Map additionalProperties; private ActivitiesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Optional remoteFields, @@ -53,7 +53,7 @@ private ActivitiesRetrieveRequest( * @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(ActivitiesRetrieveRequest 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(ActivitiesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..35b8cd94a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ActivitiesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 ActivitiesRetrieveRequestExpandItem { + public static final ActivitiesRetrieveRequestExpandItem USER = + new ActivitiesRetrieveRequestExpandItem(Value.USER, "user"); + + private final Value value; + + private final String string; + + ActivitiesRetrieveRequestExpandItem(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 ActivitiesRetrieveRequestExpandItem + && this.string.equals(((ActivitiesRetrieveRequestExpandItem) 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 UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ActivitiesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "user": + return USER; + default: + return new ActivitiesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + USER, + + UNKNOWN + } + + public interface Visitor { + T visitUser(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/Activity.java b/src/main/java/com/merge/api/ats/types/Activity.java index 0d86266ce..575e0f3a4 100644 --- a/src/main/java/com/merge/api/ats/types/Activity.java +++ b/src/main/java/com/merge/api/ats/types/Activity.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -94,8 +97,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -118,16 +124,22 @@ public Optional getModifiedAt() { /** * @return The user that performed the action. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } /** * @return When the third party's activity was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -139,24 +151,33 @@ public Optional getRemoteCreatedAt() { *
      • OTHER - OTHER
      • *
      */ - @JsonProperty("activity_type") + @JsonIgnore public Optional getActivityType() { + if (activityType == null) { + return Optional.empty(); + } return activityType; } /** * @return The activity's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } /** * @return The activity's body. */ - @JsonProperty("body") + @JsonIgnore public Optional getBody() { + if (body == null) { + return Optional.empty(); + } return body; } @@ -168,13 +189,19 @@ public Optional getBody() { *
    • PRIVATE - PRIVATE
    • *
    */ - @JsonProperty("visibility") + @JsonIgnore public Optional getVisibility() { + if (visibility == null) { + return Optional.empty(); + } return visibility; } - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } @@ -186,13 +213,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("activity_type") + private Optional _getActivityType() { + return activityType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private Optional _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("visibility") + private Optional _getVisibility() { + return visibility; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -330,6 +423,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -372,6 +476,17 @@ public Builder user(ActivityUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

    When the third party's activity was created.

    */ @@ -386,6 +501,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

    The activity's type.

    *
      @@ -405,6 +531,17 @@ public Builder activityType(ActivityActivityType activityType) { return this; } + public Builder activityType(Nullable activityType) { + if (activityType.isNull()) { + this.activityType = null; + } else if (activityType.isEmpty()) { + this.activityType = Optional.empty(); + } else { + this.activityType = Optional.of(activityType.get()); + } + return this; + } + /** *

      The activity's subject.

      */ @@ -419,6 +556,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

      The activity's body.

      */ @@ -433,6 +581,17 @@ public Builder body(String body) { return this; } + public Builder body(Nullable body) { + if (body.isNull()) { + this.body = null; + } else if (body.isEmpty()) { + this.body = Optional.empty(); + } else { + this.body = Optional.of(body.get()); + } + return this; + } + /** *

      The activity's visibility.

      *
        @@ -452,6 +611,17 @@ public Builder visibility(ActivityVisibility visibility) { return this; } + public Builder visibility(Nullable visibility) { + if (visibility.isNull()) { + this.visibility = null; + } else if (visibility.isEmpty()) { + this.visibility = Optional.empty(); + } else { + this.visibility = Optional.of(visibility.get()); + } + return this; + } + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) public Builder candidate(Optional candidate) { this.candidate = candidate; @@ -463,6 +633,17 @@ public Builder candidate(String candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + 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.

        */ @@ -488,6 +669,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -499,6 +691,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Activity build() { return new Activity( id, diff --git a/src/main/java/com/merge/api/ats/types/ActivityRequest.java b/src/main/java/com/merge/api/ats/types/ActivityRequest.java index e4728a411..2c627a49a 100644 --- a/src/main/java/com/merge/api/ats/types/ActivityRequest.java +++ b/src/main/java/com/merge/api/ats/types/ActivityRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -63,8 +66,11 @@ private ActivityRequest( /** * @return The user that performed the action. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } @@ -84,16 +90,22 @@ public Optional getActivityType() { /** * @return The activity's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } /** * @return The activity's body. */ - @JsonProperty("body") + @JsonIgnore public Optional getBody() { + if (body == null) { + return Optional.empty(); + } return body; } @@ -105,23 +117,77 @@ public Optional getBody() { *
      • PRIVATE - PRIVATE
      • *
      */ - @JsonProperty("visibility") + @JsonIgnore public Optional getVisibility() { + if (visibility == null) { + return Optional.empty(); + } return visibility; } - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private Optional _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("visibility") + private Optional _getVisibility() { + return visibility; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -218,6 +284,17 @@ public Builder user(ActivityRequestUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

      The activity's type.

      *
        @@ -251,6 +328,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

        The activity's body.

        */ @@ -265,6 +353,17 @@ public Builder body(String body) { return this; } + public Builder body(Nullable body) { + if (body.isNull()) { + this.body = null; + } else if (body.isEmpty()) { + this.body = Optional.empty(); + } else { + this.body = Optional.of(body.get()); + } + return this; + } + /** *

        The activity's visibility.

        *
          @@ -284,6 +383,17 @@ public Builder visibility(ActivityRequestVisibility visibility) { return this; } + public Builder visibility(Nullable visibility) { + if (visibility.isNull()) { + this.visibility = null; + } else if (visibility.isEmpty()) { + this.visibility = Optional.empty(); + } else { + this.visibility = Optional.of(visibility.get()); + } + return this; + } + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) public Builder candidate(Optional candidate) { this.candidate = candidate; @@ -295,6 +405,17 @@ public Builder candidate(String candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -306,6 +427,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -317,6 +449,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ActivityRequest build() { return new ActivityRequest( user, diff --git a/src/main/java/com/merge/api/ats/types/Application.java b/src/main/java/com/merge/api/ats/types/Application.java index c7fea6991..dec2a61ef 100644 --- a/src/main/java/com/merge/api/ats/types/Application.java +++ b/src/main/java/com/merge/api/ats/types/Application.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,32 +136,44 @@ public Optional getModifiedAt() { /** * @return The candidate applying. */ - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } /** * @return The job being applied for. */ - @JsonProperty("job") + @JsonIgnore public Optional getJob() { + if (job == null) { + return Optional.empty(); + } return job; } /** * @return When the application was submitted. */ - @JsonProperty("applied_at") + @JsonIgnore public Optional getAppliedAt() { + if (appliedAt == null) { + return Optional.empty(); + } return appliedAt; } /** * @return When the application was rejected. */ - @JsonProperty("rejected_at") + @JsonIgnore public Optional getRejectedAt() { + if (rejectedAt == null) { + return Optional.empty(); + } return rejectedAt; } @@ -167,16 +185,22 @@ public Optional>> getOffers() { /** * @return The application's source. */ - @JsonProperty("source") + @JsonIgnore public Optional getSource() { + if (source == null) { + return Optional.empty(); + } return source; } /** * @return The user credited for this application. */ - @JsonProperty("credited_to") + @JsonIgnore public Optional getCreditedTo() { + if (creditedTo == null) { + return Optional.empty(); + } return creditedTo; } @@ -188,16 +212,22 @@ public Optional> getScreeningQuest /** * @return The application's current stage. */ - @JsonProperty("current_stage") + @JsonIgnore public Optional getCurrentStage() { + if (currentStage == null) { + return Optional.empty(); + } return currentStage; } /** * @return The application's reason for rejection. */ - @JsonProperty("reject_reason") + @JsonIgnore public Optional getRejectReason() { + if (rejectReason == null) { + return Optional.empty(); + } return rejectReason; } @@ -209,13 +239,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job") + private Optional _getJob() { + return job; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_at") + private Optional _getAppliedAt() { + return appliedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rejected_at") + private Optional _getRejectedAt() { + return rejectedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source") + private Optional _getSource() { + return source; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credited_to") + private Optional _getCreditedTo() { + return creditedTo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("current_stage") + private Optional _getCurrentStage() { + return currentStage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reject_reason") + private Optional _getRejectReason() { + return rejectReason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -368,6 +470,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -410,6 +523,17 @@ public Builder candidate(ApplicationCandidate candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + /** *

          The job being applied for.

          */ @@ -424,6 +548,17 @@ public Builder job(ApplicationJob job) { return this; } + public Builder job(Nullable job) { + if (job.isNull()) { + this.job = null; + } else if (job.isEmpty()) { + this.job = Optional.empty(); + } else { + this.job = Optional.of(job.get()); + } + return this; + } + /** *

          When the application was submitted.

          */ @@ -438,6 +573,17 @@ public Builder appliedAt(OffsetDateTime appliedAt) { return this; } + public Builder appliedAt(Nullable appliedAt) { + if (appliedAt.isNull()) { + this.appliedAt = null; + } else if (appliedAt.isEmpty()) { + this.appliedAt = Optional.empty(); + } else { + this.appliedAt = Optional.of(appliedAt.get()); + } + return this; + } + /** *

          When the application was rejected.

          */ @@ -452,6 +598,17 @@ public Builder rejectedAt(OffsetDateTime rejectedAt) { return this; } + public Builder rejectedAt(Nullable rejectedAt) { + if (rejectedAt.isNull()) { + this.rejectedAt = null; + } else if (rejectedAt.isEmpty()) { + this.rejectedAt = Optional.empty(); + } else { + this.rejectedAt = Optional.of(rejectedAt.get()); + } + return this; + } + @JsonSetter(value = "offers", nulls = Nulls.SKIP) public Builder offers(Optional>> offers) { this.offers = offers; @@ -477,6 +634,17 @@ public Builder source(String source) { return this; } + public Builder source(Nullable source) { + if (source.isNull()) { + this.source = null; + } else if (source.isEmpty()) { + this.source = Optional.empty(); + } else { + this.source = Optional.of(source.get()); + } + return this; + } + /** *

          The user credited for this application.

          */ @@ -491,6 +659,17 @@ public Builder creditedTo(ApplicationCreditedTo creditedTo) { return this; } + public Builder creditedTo(Nullable creditedTo) { + if (creditedTo.isNull()) { + this.creditedTo = null; + } else if (creditedTo.isEmpty()) { + this.creditedTo = Optional.empty(); + } else { + this.creditedTo = Optional.of(creditedTo.get()); + } + return this; + } + @JsonSetter(value = "screening_question_answers", nulls = Nulls.SKIP) public Builder screeningQuestionAnswers( Optional> screeningQuestionAnswers) { @@ -518,6 +697,17 @@ public Builder currentStage(ApplicationCurrentStage currentStage) { return this; } + public Builder currentStage(Nullable currentStage) { + if (currentStage.isNull()) { + this.currentStage = null; + } else if (currentStage.isEmpty()) { + this.currentStage = Optional.empty(); + } else { + this.currentStage = Optional.of(currentStage.get()); + } + return this; + } + /** *

          The application's reason for rejection.

          */ @@ -532,6 +722,17 @@ public Builder rejectReason(ApplicationRejectReason rejectReason) { return this; } + public Builder rejectReason(Nullable rejectReason) { + if (rejectReason.isNull()) { + this.rejectReason = null; + } else if (rejectReason.isEmpty()) { + this.rejectReason = Optional.empty(); + } else { + this.rejectReason = Optional.of(rejectReason.get()); + } + 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.

          */ @@ -557,6 +758,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -568,6 +780,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Application build() { return new Application( id, diff --git a/src/main/java/com/merge/api/ats/types/ApplicationRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationRequest.java index c7e113dec..ccbe27b6b 100644 --- a/src/main/java/com/merge/api/ats/types/ApplicationRequest.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -85,32 +88,44 @@ private ApplicationRequest( /** * @return The candidate applying. */ - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } /** * @return The job being applied for. */ - @JsonProperty("job") + @JsonIgnore public Optional getJob() { + if (job == null) { + return Optional.empty(); + } return job; } /** * @return When the application was submitted. */ - @JsonProperty("applied_at") + @JsonIgnore public Optional getAppliedAt() { + if (appliedAt == null) { + return Optional.empty(); + } return appliedAt; } /** * @return When the application was rejected. */ - @JsonProperty("rejected_at") + @JsonIgnore public Optional getRejectedAt() { + if (rejectedAt == null) { + return Optional.empty(); + } return rejectedAt; } @@ -122,16 +137,22 @@ public Optional>> getOffers() { /** * @return The application's source. */ - @JsonProperty("source") + @JsonIgnore public Optional getSource() { + if (source == null) { + return Optional.empty(); + } return source; } /** * @return The user credited for this application. */ - @JsonProperty("credited_to") + @JsonIgnore public Optional getCreditedTo() { + if (creditedTo == null) { + return Optional.empty(); + } return creditedTo; } @@ -143,31 +164,112 @@ public Optional> getScreeni /** * @return The application's current stage. */ - @JsonProperty("current_stage") + @JsonIgnore public Optional getCurrentStage() { + if (currentStage == null) { + return Optional.empty(); + } return currentStage; } /** * @return The application's reason for rejection. */ - @JsonProperty("reject_reason") + @JsonIgnore public Optional getRejectReason() { + if (rejectReason == null) { + return Optional.empty(); + } return rejectReason; } - @JsonProperty("remote_template_id") + @JsonIgnore public Optional getRemoteTemplateId() { + if (remoteTemplateId == null) { + return Optional.empty(); + } return remoteTemplateId; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job") + private Optional _getJob() { + return job; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("applied_at") + private Optional _getAppliedAt() { + return appliedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("rejected_at") + private Optional _getRejectedAt() { + return rejectedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source") + private Optional _getSource() { + return source; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("credited_to") + private Optional _getCreditedTo() { + return creditedTo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("current_stage") + private Optional _getCurrentStage() { + return currentStage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("reject_reason") + private Optional _getRejectReason() { + return rejectReason; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_template_id") + private Optional _getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -290,6 +392,17 @@ public Builder candidate(ApplicationRequestCandidate candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + /** *

          The job being applied for.

          */ @@ -304,6 +417,17 @@ public Builder job(ApplicationRequestJob job) { return this; } + public Builder job(Nullable job) { + if (job.isNull()) { + this.job = null; + } else if (job.isEmpty()) { + this.job = Optional.empty(); + } else { + this.job = Optional.of(job.get()); + } + return this; + } + /** *

          When the application was submitted.

          */ @@ -318,6 +442,17 @@ public Builder appliedAt(OffsetDateTime appliedAt) { return this; } + public Builder appliedAt(Nullable appliedAt) { + if (appliedAt.isNull()) { + this.appliedAt = null; + } else if (appliedAt.isEmpty()) { + this.appliedAt = Optional.empty(); + } else { + this.appliedAt = Optional.of(appliedAt.get()); + } + return this; + } + /** *

          When the application was rejected.

          */ @@ -332,6 +467,17 @@ public Builder rejectedAt(OffsetDateTime rejectedAt) { return this; } + public Builder rejectedAt(Nullable rejectedAt) { + if (rejectedAt.isNull()) { + this.rejectedAt = null; + } else if (rejectedAt.isEmpty()) { + this.rejectedAt = Optional.empty(); + } else { + this.rejectedAt = Optional.of(rejectedAt.get()); + } + return this; + } + @JsonSetter(value = "offers", nulls = Nulls.SKIP) public Builder offers(Optional>> offers) { this.offers = offers; @@ -357,6 +503,17 @@ public Builder source(String source) { return this; } + public Builder source(Nullable source) { + if (source.isNull()) { + this.source = null; + } else if (source.isEmpty()) { + this.source = Optional.empty(); + } else { + this.source = Optional.of(source.get()); + } + return this; + } + /** *

          The user credited for this application.

          */ @@ -371,6 +528,17 @@ public Builder creditedTo(ApplicationRequestCreditedTo creditedTo) { return this; } + public Builder creditedTo(Nullable creditedTo) { + if (creditedTo.isNull()) { + this.creditedTo = null; + } else if (creditedTo.isEmpty()) { + this.creditedTo = Optional.empty(); + } else { + this.creditedTo = Optional.of(creditedTo.get()); + } + return this; + } + @JsonSetter(value = "screening_question_answers", nulls = Nulls.SKIP) public Builder screeningQuestionAnswers( Optional> screeningQuestionAnswers) { @@ -398,6 +566,17 @@ public Builder currentStage(ApplicationRequestCurrentStage currentStage) { return this; } + public Builder currentStage(Nullable currentStage) { + if (currentStage.isNull()) { + this.currentStage = null; + } else if (currentStage.isEmpty()) { + this.currentStage = Optional.empty(); + } else { + this.currentStage = Optional.of(currentStage.get()); + } + return this; + } + /** *

          The application's reason for rejection.

          */ @@ -412,6 +591,17 @@ public Builder rejectReason(ApplicationRequestRejectReason rejectReason) { return this; } + public Builder rejectReason(Nullable rejectReason) { + if (rejectReason.isNull()) { + this.rejectReason = null; + } else if (rejectReason.isEmpty()) { + this.rejectReason = Optional.empty(); + } else { + this.rejectReason = Optional.of(rejectReason.get()); + } + return this; + } + @JsonSetter(value = "remote_template_id", nulls = Nulls.SKIP) public Builder remoteTemplateId(Optional remoteTemplateId) { this.remoteTemplateId = remoteTemplateId; @@ -423,6 +613,17 @@ public Builder remoteTemplateId(String remoteTemplateId) { return this; } + public Builder remoteTemplateId(Nullable remoteTemplateId) { + if (remoteTemplateId.isNull()) { + this.remoteTemplateId = null; + } else if (remoteTemplateId.isEmpty()) { + this.remoteTemplateId = Optional.empty(); + } else { + this.remoteTemplateId = Optional.of(remoteTemplateId.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -434,6 +635,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -445,6 +657,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ApplicationRequest build() { return new ApplicationRequest( candidate, diff --git a/src/main/java/com/merge/api/ats/types/ApplicationsListRequest.java b/src/main/java/com/merge/api/ats/types/ApplicationsListRequest.java index 884496705..fc418bbb8 100644 --- a/src/main/java/com/merge/api/ats/types/ApplicationsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ApplicationsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -221,16 +224,34 @@ public Optional getRejectReasonId() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return applications with this source. */ - @JsonProperty("source") + @JsonIgnore public Optional getSource() { + if (source == null) { + return Optional.empty(); + } + return source; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("source") + private Optional _getSource() { return source; } @@ -587,6 +608,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          If provided, will only return applications with this source.

          */ @@ -601,6 +633,17 @@ public Builder source(String source) { return this; } + public Builder source(Nullable source) { + if (source.isNull()) { + this.source = null; + } else if (source.isEmpty()) { + this.source = Optional.empty(); + } else { + this.source = Optional.of(source.get()); + } + return this; + } + public ApplicationsListRequest build() { return new ApplicationsListRequest( expand, diff --git a/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..6f7827dfb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/Attachment.java b/src/main/java/com/merge/api/ats/types/Attachment.java index 7c88304bb..f5b5b2efe 100644 --- a/src/main/java/com/merge/api/ats/types/Attachment.java +++ b/src/main/java/com/merge/api/ats/types/Attachment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,24 +112,33 @@ public Optional getModifiedAt() { /** * @return The attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The attachment's url. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return */ - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } @@ -136,8 +151,11 @@ public Optional getCandidate() { *
        • OTHER - OTHER
        • *
        */ - @JsonProperty("attachment_type") + @JsonIgnore public Optional getAttachmentType() { + if (attachmentType == null) { + return Optional.empty(); + } return attachmentType; } @@ -149,13 +167,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("attachment_type") + private Optional _getAttachmentType() { + return attachmentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -278,6 +344,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -320,6 +397,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

        The attachment's url.

        */ @@ -334,6 +422,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) public Builder candidate(Optional candidate) { this.candidate = candidate; @@ -345,6 +444,17 @@ public Builder candidate(String candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + /** *

        The attachment's type.

        *
          @@ -365,6 +475,17 @@ public Builder attachmentType(AttachmentAttachmentType attachmentType) { return this; } + public Builder attachmentType(Nullable attachmentType) { + if (attachmentType.isNull()) { + this.attachmentType = null; + } else if (attachmentType.isEmpty()) { + this.attachmentType = Optional.empty(); + } else { + this.attachmentType = Optional.of(attachmentType.get()); + } + 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.

          */ @@ -390,6 +511,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -401,6 +533,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Attachment build() { return new Attachment( id, diff --git a/src/main/java/com/merge/api/ats/types/AttachmentRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentRequest.java index b4e4db3f8..7163dde15 100644 --- a/src/main/java/com/merge/api/ats/types/AttachmentRequest.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -55,24 +58,33 @@ private AttachmentRequest( /** * @return The attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The attachment's url. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return */ - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } @@ -85,18 +97,63 @@ public Optional getCandidate() { *
        • OTHER - OTHER
        • *
        */ - @JsonProperty("attachment_type") + @JsonIgnore public Optional getAttachmentType() { + if (attachmentType == null) { + return Optional.empty(); + } return attachmentType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("attachment_type") + private Optional _getAttachmentType() { + return attachmentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -183,6 +240,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

        The attachment's url.

        */ @@ -197,6 +265,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + @JsonSetter(value = "candidate", nulls = Nulls.SKIP) public Builder candidate(Optional candidate) { this.candidate = candidate; @@ -208,6 +287,17 @@ public Builder candidate(String candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + /** *

        The attachment's type.

        *
          @@ -228,6 +318,17 @@ public Builder attachmentType(AttachmentRequestAttachmentType attachmentType) { return this; } + public Builder attachmentType(Nullable attachmentType) { + if (attachmentType.isNull()) { + this.attachmentType = null; + } else if (attachmentType.isEmpty()) { + this.attachmentType = Optional.empty(); + } else { + this.attachmentType = Optional.of(attachmentType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -239,6 +340,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -250,6 +362,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AttachmentRequest build() { return new AttachmentRequest( fileName, diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java index 08fee160b..2a5c8f239 100644 --- a/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AttachmentsListRequest.Builder.class) public final class AttachmentsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional candidateId; @@ -45,16 +48,16 @@ public final class AttachmentsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private AttachmentsListRequest( - Optional> expand, + Optional> expand, Optional candidateId, Optional createdAfter, Optional createdBefore, @@ -65,9 +68,9 @@ private AttachmentsListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.candidateId = candidateId; @@ -90,7 +93,7 @@ private AttachmentsListRequest( * @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; } @@ -178,15 +181,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -194,10 +200,16 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,7 +268,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 candidateId = Optional.empty(); @@ -278,11 +290,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -311,17 +323,17 @@ public Builder from(AttachmentsListRequest 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(AttachmentsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -470,12 +482,12 @@ public Builder pageSize(Integer pageSize) { *

          Deprecated. Use show_enum_origins.

          */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(AttachmentsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -494,16 +506,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(AttachmentsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestExpandItem.java new file mode 100644 index 000000000..550d8ac94 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsListRequestExpandItem { + public static final AttachmentsListRequestExpandItem CANDIDATE = + new AttachmentsListRequestExpandItem(Value.CANDIDATE, "candidate"); + + private final Value value; + + private final String string; + + AttachmentsListRequestExpandItem(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 AttachmentsListRequestExpandItem + && this.string.equals(((AttachmentsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CANDIDATE: + return visitor.visitCandidate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsListRequestExpandItem valueOf(String value) { + switch (value) { + case "candidate": + return CANDIDATE; + default: + return new AttachmentsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + CANDIDATE, + + UNKNOWN + } + + public interface Visitor { + T visitCandidate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestRemoteFields.java new file mode 100644 index 000000000..5bc938489 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsListRequestRemoteFields { + public static final AttachmentsListRequestRemoteFields ATTACHMENT_TYPE = + new AttachmentsListRequestRemoteFields(Value.ATTACHMENT_TYPE, "attachment_type"); + + private final Value value; + + private final String string; + + AttachmentsListRequestRemoteFields(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 AttachmentsListRequestRemoteFields + && this.string.equals(((AttachmentsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ATTACHMENT_TYPE: + return visitor.visitAttachmentType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "attachment_type": + return ATTACHMENT_TYPE; + default: + return new AttachmentsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAttachmentType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..6f3eba746 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsListRequestShowEnumOrigins { + public static final AttachmentsListRequestShowEnumOrigins ATTACHMENT_TYPE = + new AttachmentsListRequestShowEnumOrigins(Value.ATTACHMENT_TYPE, "attachment_type"); + + private final Value value; + + private final String string; + + AttachmentsListRequestShowEnumOrigins(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 AttachmentsListRequestShowEnumOrigins + && this.string.equals(((AttachmentsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ATTACHMENT_TYPE: + return visitor.visitAttachmentType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "attachment_type": + return ATTACHMENT_TYPE; + default: + return new AttachmentsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAttachmentType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java index fff610e32..bf61e7bf4 100644 --- a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequest.java @@ -22,24 +22,24 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) public final class AttachmentsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private AttachmentsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -53,7 +53,7 @@ private AttachmentsRetrieveRequest( * @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; } @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -125,15 +125,15 @@ 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(); private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -153,17 +153,17 @@ public Builder from(AttachmentsRetrieveRequest 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(AttachmentsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

          Deprecated. Use show_enum_origins.

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

          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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(AttachmentsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..f86cd99a1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsRetrieveRequestExpandItem { + public static final AttachmentsRetrieveRequestExpandItem CANDIDATE = + new AttachmentsRetrieveRequestExpandItem(Value.CANDIDATE, "candidate"); + + private final Value value; + + private final String string; + + AttachmentsRetrieveRequestExpandItem(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 AttachmentsRetrieveRequestExpandItem + && this.string.equals(((AttachmentsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CANDIDATE: + return visitor.visitCandidate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "candidate": + return CANDIDATE; + default: + return new AttachmentsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + CANDIDATE, + + UNKNOWN + } + + public interface Visitor { + T visitCandidate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..cf6931ba7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsRetrieveRequestRemoteFields { + public static final AttachmentsRetrieveRequestRemoteFields ATTACHMENT_TYPE = + new AttachmentsRetrieveRequestRemoteFields(Value.ATTACHMENT_TYPE, "attachment_type"); + + private final Value value; + + private final String string; + + AttachmentsRetrieveRequestRemoteFields(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 AttachmentsRetrieveRequestRemoteFields + && this.string.equals(((AttachmentsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ATTACHMENT_TYPE: + return visitor.visitAttachmentType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "attachment_type": + return ATTACHMENT_TYPE; + default: + return new AttachmentsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAttachmentType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..d5036c32e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/AttachmentsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsRetrieveRequestShowEnumOrigins { + public static final AttachmentsRetrieveRequestShowEnumOrigins ATTACHMENT_TYPE = + new AttachmentsRetrieveRequestShowEnumOrigins(Value.ATTACHMENT_TYPE, "attachment_type"); + + private final Value value; + + private final String string; + + AttachmentsRetrieveRequestShowEnumOrigins(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 AttachmentsRetrieveRequestShowEnumOrigins + && this.string.equals(((AttachmentsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ATTACHMENT_TYPE: + return visitor.visitAttachmentType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "attachment_type": + return ATTACHMENT_TYPE; + default: + return new AttachmentsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTACHMENT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAttachmentType(); + + T visitUnknown(String unknownType); + } +} 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..78bc8b30c 100644 --- a/src/main/java/com/merge/api/ats/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/ats/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

          The User's email at the time of this Event occurring.

          */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ats/types/Candidate.java b/src/main/java/com/merge/api/ats/types/Candidate.java index 274b1c3d5..9e6b336fb 100644 --- a/src/main/java/com/merge/api/ats/types/Candidate.java +++ b/src/main/java/com/merge/api/ats/types/Candidate.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -130,8 +133,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -154,80 +160,110 @@ public Optional getModifiedAt() { /** * @return The candidate's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The candidate's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The candidate's current company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The candidate's current title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } /** * @return When the third party's candidate was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's candidate was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the most recent interaction with the candidate occurred. */ - @JsonProperty("last_interaction_at") + @JsonIgnore public Optional getLastInteractionAt() { + if (lastInteractionAt == null) { + return Optional.empty(); + } return lastInteractionAt; } /** * @return Whether or not the candidate is private. */ - @JsonProperty("is_private") + @JsonIgnore public Optional getIsPrivate() { + if (isPrivate == null) { + return Optional.empty(); + } return isPrivate; } /** * @return Whether or not the candidate can be emailed. */ - @JsonProperty("can_email") + @JsonIgnore public Optional getCanEmail() { + if (canEmail == null) { + return Optional.empty(); + } return canEmail; } /** * @return The candidate's locations. */ - @JsonProperty("locations") + @JsonIgnore public Optional>> getLocations() { + if (locations == null) { + return Optional.empty(); + } return locations; } @@ -278,13 +314,97 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_interaction_at") + private Optional _getLastInteractionAt() { + return lastInteractionAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_private") + private Optional _getIsPrivate() { + return isPrivate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("can_email") + private Optional _getCanEmail() { + return canEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("locations") + private Optional>> _getLocations() { + return locations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -467,6 +587,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -509,6 +640,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The candidate's last name.

          */ @@ -523,6 +665,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

          The candidate's current company.

          */ @@ -537,6 +690,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The candidate's current title.

          */ @@ -551,6 +715,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

          When the third party's candidate was created.

          */ @@ -565,6 +740,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

          When the third party's candidate was updated.

          */ @@ -579,6 +765,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

          When the most recent interaction with the candidate occurred.

          */ @@ -593,6 +790,17 @@ public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { return this; } + public Builder lastInteractionAt(Nullable lastInteractionAt) { + if (lastInteractionAt.isNull()) { + this.lastInteractionAt = null; + } else if (lastInteractionAt.isEmpty()) { + this.lastInteractionAt = Optional.empty(); + } else { + this.lastInteractionAt = Optional.of(lastInteractionAt.get()); + } + return this; + } + /** *

          Whether or not the candidate is private.

          */ @@ -607,6 +815,17 @@ public Builder isPrivate(Boolean isPrivate) { return this; } + public Builder isPrivate(Nullable isPrivate) { + if (isPrivate.isNull()) { + this.isPrivate = null; + } else if (isPrivate.isEmpty()) { + this.isPrivate = Optional.empty(); + } else { + this.isPrivate = Optional.of(isPrivate.get()); + } + return this; + } + /** *

          Whether or not the candidate can be emailed.

          */ @@ -621,6 +840,17 @@ public Builder canEmail(Boolean canEmail) { return this; } + public Builder canEmail(Nullable canEmail) { + if (canEmail.isNull()) { + this.canEmail = null; + } else if (canEmail.isEmpty()) { + this.canEmail = Optional.empty(); + } else { + this.canEmail = Optional.of(canEmail.get()); + } + return this; + } + /** *

          The candidate's locations.

          */ @@ -635,6 +865,17 @@ public Builder locations(List> locations) { return this; } + public Builder locations(Nullable>> locations) { + if (locations.isNull()) { + this.locations = null; + } else if (locations.isEmpty()) { + this.locations = Optional.empty(); + } else { + this.locations = Optional.of(locations.get()); + } + return this; + } + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; @@ -735,6 +976,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -746,6 +998,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Candidate build() { return new Candidate( id, diff --git a/src/main/java/com/merge/api/ats/types/CandidateRequest.java b/src/main/java/com/merge/api/ats/types/CandidateRequest.java index 34fbbf7a7..a55790066 100644 --- a/src/main/java/com/merge/api/ats/types/CandidateRequest.java +++ b/src/main/java/com/merge/api/ats/types/CandidateRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -101,64 +104,88 @@ private CandidateRequest( /** * @return The candidate's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The candidate's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The candidate's current company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The candidate's current title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } /** * @return When the most recent interaction with the candidate occurred. */ - @JsonProperty("last_interaction_at") + @JsonIgnore public Optional getLastInteractionAt() { + if (lastInteractionAt == null) { + return Optional.empty(); + } return lastInteractionAt; } /** * @return Whether or not the candidate is private. */ - @JsonProperty("is_private") + @JsonIgnore public Optional getIsPrivate() { + if (isPrivate == null) { + return Optional.empty(); + } return isPrivate; } /** * @return Whether or not the candidate can be emailed. */ - @JsonProperty("can_email") + @JsonIgnore public Optional getCanEmail() { + if (canEmail == null) { + return Optional.empty(); + } return canEmail; } /** * @return The candidate's locations. */ - @JsonProperty("locations") + @JsonIgnore public Optional>> getLocations() { + if (locations == null) { + return Optional.empty(); + } return locations; } @@ -201,18 +228,93 @@ public Optional>> getAttachments( return attachments; } - @JsonProperty("remote_template_id") + @JsonIgnore public Optional getRemoteTemplateId() { + if (remoteTemplateId == null) { + return Optional.empty(); + } return remoteTemplateId; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_interaction_at") + private Optional _getLastInteractionAt() { + return lastInteractionAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_private") + private Optional _getIsPrivate() { + return isPrivate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("can_email") + private Optional _getCanEmail() { + return canEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("locations") + private Optional>> _getLocations() { + return locations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_template_id") + private Optional _getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -354,6 +456,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The candidate's last name.

          */ @@ -368,6 +481,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

          The candidate's current company.

          */ @@ -382,6 +506,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The candidate's current title.

          */ @@ -396,6 +531,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

          When the most recent interaction with the candidate occurred.

          */ @@ -410,6 +556,17 @@ public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { return this; } + public Builder lastInteractionAt(Nullable lastInteractionAt) { + if (lastInteractionAt.isNull()) { + this.lastInteractionAt = null; + } else if (lastInteractionAt.isEmpty()) { + this.lastInteractionAt = Optional.empty(); + } else { + this.lastInteractionAt = Optional.of(lastInteractionAt.get()); + } + return this; + } + /** *

          Whether or not the candidate is private.

          */ @@ -424,6 +581,17 @@ public Builder isPrivate(Boolean isPrivate) { return this; } + public Builder isPrivate(Nullable isPrivate) { + if (isPrivate.isNull()) { + this.isPrivate = null; + } else if (isPrivate.isEmpty()) { + this.isPrivate = Optional.empty(); + } else { + this.isPrivate = Optional.of(isPrivate.get()); + } + return this; + } + /** *

          Whether or not the candidate can be emailed.

          */ @@ -438,6 +606,17 @@ public Builder canEmail(Boolean canEmail) { return this; } + public Builder canEmail(Nullable canEmail) { + if (canEmail.isNull()) { + this.canEmail = null; + } else if (canEmail.isEmpty()) { + this.canEmail = Optional.empty(); + } else { + this.canEmail = Optional.of(canEmail.get()); + } + return this; + } + /** *

          The candidate's locations.

          */ @@ -452,6 +631,17 @@ public Builder locations(List> locations) { return this; } + public Builder locations(Nullable>> locations) { + if (locations.isNull()) { + this.locations = null; + } else if (locations.isEmpty()) { + this.locations = Optional.empty(); + } else { + this.locations = Optional.of(locations.get()); + } + return this; + } + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; @@ -538,6 +728,17 @@ public Builder remoteTemplateId(String remoteTemplateId) { return this; } + public Builder remoteTemplateId(Nullable remoteTemplateId) { + if (remoteTemplateId.isNull()) { + this.remoteTemplateId = null; + } else if (remoteTemplateId.isEmpty()) { + this.remoteTemplateId = Optional.empty(); + } else { + this.remoteTemplateId = Optional.of(remoteTemplateId.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -549,6 +750,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -560,6 +772,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CandidateRequest build() { return new CandidateRequest( firstName, diff --git a/src/main/java/com/merge/api/ats/types/CandidatesIgnoreCreateRequest.java b/src/main/java/com/merge/api/ats/types/CandidatesIgnoreCreateRequest.java new file mode 100644 index 000000000..b5e31f9d0 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CandidatesIgnoreCreateRequest.java @@ -0,0 +1,102 @@ +/** + * 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 = CandidatesIgnoreCreateRequest.Builder.class) +public final class CandidatesIgnoreCreateRequest { + private final IgnoreCommonModelRequest body; + + private final Map additionalProperties; + + private CandidatesIgnoreCreateRequest(IgnoreCommonModelRequest body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public IgnoreCommonModelRequest getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidatesIgnoreCreateRequest && equalTo((CandidatesIgnoreCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CandidatesIgnoreCreateRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyStage builder() { + return new Builder(); + } + + public interface BodyStage { + _FinalStage body(@NotNull IgnoreCommonModelRequest body); + + Builder from(CandidatesIgnoreCreateRequest other); + } + + public interface _FinalStage { + CandidatesIgnoreCreateRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private IgnoreCommonModelRequest body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CandidatesIgnoreCreateRequest other) { + body(other.getBody()); + return this; + } + + @java.lang.Override + @JsonSetter("body") + public _FinalStage body(@NotNull IgnoreCommonModelRequest body) { + this.body = body; + return this; + } + + @java.lang.Override + public CandidatesIgnoreCreateRequest build() { + return new CandidatesIgnoreCreateRequest(body, additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/CandidatesListRequest.java b/src/main/java/com/merge/api/ats/types/CandidatesListRequest.java index b2721928a..786dcebc7 100644 --- a/src/main/java/com/merge/api/ats/types/CandidatesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/CandidatesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -133,8 +136,11 @@ public Optional getEmailAddresses() { /** * @return If provided, will only return candidates with this first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } @@ -165,8 +171,11 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return candidates with this last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } @@ -197,8 +206,11 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -210,6 +222,24 @@ public Optional getTags() { return tags; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -413,6 +443,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + 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.

          */ @@ -469,6 +510,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

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

          */ @@ -525,6 +577,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          If provided, will only return candidates with these tags; multiple tags can be separated by commas.

          */ diff --git a/src/main/java/com/merge/api/ats/types/CandidatesMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/CandidatesMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..f8c04f86e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/CandidatesMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CandidatesMetaPatchRetrieveRequest.Builder.class) +public final class CandidatesMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private CandidatesMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CandidatesMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CandidatesMetaPatchRetrieveRequest other) { + return this; + } + + public CandidatesMetaPatchRetrieveRequest build() { + return new CandidatesMetaPatchRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java index 0e7c6b49e..d9dc33832 100644 --- a/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/ats/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

          The data with the request. You must include a request_format parameter matching the data's format

          */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

          Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

          */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

          */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

          */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ats/types/Department.java b/src/main/java/com/merge/api/ats/types/Department.java index de86970fb..a664deca9 100644 --- a/src/main/java/com/merge/api/ats/types/Department.java +++ b/src/main/java/com/merge/api/ats/types/Department.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -70,8 +73,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -94,8 +100,11 @@ public Optional getModifiedAt() { /** * @return The department's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -107,13 +116,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -221,6 +260,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -263,6 +313,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + 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.

          */ @@ -288,6 +349,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -299,6 +371,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Department build() { return new Department( id, diff --git a/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java b/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java index 23e3ed9ed..e2d0e354c 100644 --- a/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/DepartmentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public DepartmentsListRequest build() { return new DepartmentsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ats/types/Eeoc.java b/src/main/java/com/merge/api/ats/types/Eeoc.java index d71a7ba89..9d087a629 100644 --- a/src/main/java/com/merge/api/ats/types/Eeoc.java +++ b/src/main/java/com/merge/api/ats/types/Eeoc.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,16 +120,22 @@ public Optional getModifiedAt() { /** * @return The candidate being represented. */ - @JsonProperty("candidate") + @JsonIgnore public Optional getCandidate() { + if (candidate == null) { + return Optional.empty(); + } return candidate; } /** * @return When the information was submitted. */ - @JsonProperty("submitted_at") + @JsonIgnore public Optional getSubmittedAt() { + if (submittedAt == null) { + return Optional.empty(); + } return submittedAt; } @@ -140,8 +152,11 @@ public Optional getSubmittedAt() { *
        • DECLINE_TO_SELF_IDENTIFY - DECLINE_TO_SELF_IDENTIFY
        • *
        */ - @JsonProperty("race") + @JsonIgnore public Optional getRace() { + if (race == null) { + return Optional.empty(); + } return race; } @@ -155,8 +170,11 @@ public Optional getRace() { *
      • DECLINE_TO_SELF_IDENTIFY - DECLINE_TO_SELF_IDENTIFY
      • *
      */ - @JsonProperty("gender") + @JsonIgnore public Optional getGender() { + if (gender == null) { + return Optional.empty(); + } return gender; } @@ -168,8 +186,11 @@ public Optional getGender() { *
    • I_DONT_WISH_TO_ANSWER - I_DONT_WISH_TO_ANSWER
    • *
    */ - @JsonProperty("veteran_status") + @JsonIgnore public Optional getVeteranStatus() { + if (veteranStatus == null) { + return Optional.empty(); + } return veteranStatus; } @@ -181,8 +202,11 @@ public Optional getVeteranStatus() { *
  • I_DONT_WISH_TO_ANSWER - I_DONT_WISH_TO_ANSWER
  • * */ - @JsonProperty("disability_status") + @JsonIgnore public Optional getDisabilityStatus() { + if (disabilityStatus == null) { + return Optional.empty(); + } return disabilityStatus; } @@ -194,13 +218,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("candidate") + private Optional _getCandidate() { + return candidate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("submitted_at") + private Optional _getSubmittedAt() { + return submittedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("race") + private Optional _getRace() { + return race; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gender") + private Optional _getGender() { + return gender; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("veteran_status") + private Optional _getVeteranStatus() { + return veteranStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disability_status") + private Optional _getDisabilityStatus() { + return disabilityStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -333,6 +417,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -375,6 +470,17 @@ public Builder candidate(EeocCandidate candidate) { return this; } + public Builder candidate(Nullable candidate) { + if (candidate.isNull()) { + this.candidate = null; + } else if (candidate.isEmpty()) { + this.candidate = Optional.empty(); + } else { + this.candidate = Optional.of(candidate.get()); + } + return this; + } + /** *

    When the information was submitted.

    */ @@ -389,6 +495,17 @@ public Builder submittedAt(OffsetDateTime submittedAt) { return this; } + public Builder submittedAt(Nullable submittedAt) { + if (submittedAt.isNull()) { + this.submittedAt = null; + } else if (submittedAt.isEmpty()) { + this.submittedAt = Optional.empty(); + } else { + this.submittedAt = Optional.of(submittedAt.get()); + } + return this; + } + /** *

    The candidate's race.

    *
      @@ -413,6 +530,17 @@ public Builder race(EeocRace race) { return this; } + public Builder race(Nullable race) { + if (race.isNull()) { + this.race = null; + } else if (race.isEmpty()) { + this.race = Optional.empty(); + } else { + this.race = Optional.of(race.get()); + } + return this; + } + /** *

      The candidate's gender.

      *
        @@ -434,6 +562,17 @@ public Builder gender(EeocGender gender) { return this; } + public Builder gender(Nullable gender) { + if (gender.isNull()) { + this.gender = null; + } else if (gender.isEmpty()) { + this.gender = Optional.empty(); + } else { + this.gender = Optional.of(gender.get()); + } + return this; + } + /** *

        The candidate's veteran status.

        *
          @@ -453,6 +592,17 @@ public Builder veteranStatus(EeocVeteranStatus veteranStatus) { return this; } + public Builder veteranStatus(Nullable veteranStatus) { + if (veteranStatus.isNull()) { + this.veteranStatus = null; + } else if (veteranStatus.isEmpty()) { + this.veteranStatus = Optional.empty(); + } else { + this.veteranStatus = Optional.of(veteranStatus.get()); + } + return this; + } + /** *

          The candidate's disability status.

          *
            @@ -472,6 +622,17 @@ public Builder disabilityStatus(EeocDisabilityStatus disabilityStatus) { return this; } + public Builder disabilityStatus(Nullable disabilityStatus) { + if (disabilityStatus.isNull()) { + this.disabilityStatus = null; + } else if (disabilityStatus.isEmpty()) { + this.disabilityStatus = Optional.empty(); + } else { + this.disabilityStatus = Optional.of(disabilityStatus.get()); + } + 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.

            */ @@ -497,6 +658,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -508,6 +680,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Eeoc build() { return new Eeoc( id, 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..5a62a556b 100644 --- a/src/main/java/com/merge/api/ats/types/EeocsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EeocsListRequest.Builder.class) public final class EeocsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional candidateId; @@ -54,7 +57,7 @@ public final class EeocsListRequest { private final Map additionalProperties; private EeocsListRequest( - Optional> expand, + Optional> expand, Optional candidateId, Optional createdAfter, Optional createdBefore, @@ -90,7 +93,7 @@ private EeocsListRequest( * @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; } @@ -185,8 +188,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -198,6 +204,12 @@ public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -256,7 +268,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 candidateId = Optional.empty(); @@ -311,17 +323,17 @@ public Builder from(EeocsListRequest 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(EeocsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -494,6 +506,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

            */ diff --git a/src/main/java/com/merge/api/ats/types/EeocsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/EeocsListRequestExpandItem.java new file mode 100644 index 000000000..95a5e5893 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EeocsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 EeocsListRequestExpandItem { + public static final EeocsListRequestExpandItem CANDIDATE = + new EeocsListRequestExpandItem(Value.CANDIDATE, "candidate"); + + private final Value value; + + private final String string; + + EeocsListRequestExpandItem(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 EeocsListRequestExpandItem + && this.string.equals(((EeocsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CANDIDATE: + return visitor.visitCandidate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EeocsListRequestExpandItem valueOf(String value) { + switch (value) { + case "candidate": + return CANDIDATE; + default: + return new EeocsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + CANDIDATE, + + UNKNOWN + } + + public interface Visitor { + T visitCandidate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java index dbf508aea..f5ab34738 100644 --- a/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = EeocsRetrieveRequest.Builder.class) public final class EeocsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -35,7 +35,7 @@ public final class EeocsRetrieveRequest { private final Map additionalProperties; private EeocsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Optional remoteFields, @@ -53,7 +53,7 @@ private EeocsRetrieveRequest( * @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(EeocsRetrieveRequest 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(EeocsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..4b298bd0f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/EeocsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 EeocsRetrieveRequestExpandItem { + public static final EeocsRetrieveRequestExpandItem CANDIDATE = + new EeocsRetrieveRequestExpandItem(Value.CANDIDATE, "candidate"); + + private final Value value; + + private final String string; + + EeocsRetrieveRequestExpandItem(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 EeocsRetrieveRequestExpandItem + && this.string.equals(((EeocsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CANDIDATE: + return visitor.visitCandidate(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static EeocsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "candidate": + return CANDIDATE; + default: + return new EeocsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + CANDIDATE, + + UNKNOWN + } + + public interface Visitor { + T visitCandidate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/EmailAddress.java b/src/main/java/com/merge/api/ats/types/EmailAddress.java index e60bfd5b8..c0296acbd 100644 --- a/src/main/java/com/merge/api/ats/types/EmailAddress.java +++ b/src/main/java/com/merge/api/ats/types/EmailAddress.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -67,8 +70,11 @@ public Optional getModifiedAt() { /** * @return The email address. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -80,8 +86,11 @@ public Optional getValue() { *
          • OTHER - OTHER
          • *
          */ - @JsonProperty("email_address_type") + @JsonIgnore public Optional getEmailAddressType() { + if (emailAddressType == null) { + return Optional.empty(); + } return emailAddressType; } @@ -93,6 +102,18 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address_type") + private Optional _getEmailAddressType() { + return emailAddressType; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -194,6 +215,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

          The type of email address.

          *
            @@ -213,6 +245,17 @@ public Builder emailAddressType(EmailAddressEmailAddressType emailAddressType) { return this; } + public Builder emailAddressType(Nullable emailAddressType) { + if (emailAddressType.isNull()) { + this.emailAddressType = null; + } else if (emailAddressType.isEmpty()) { + this.emailAddressType = Optional.empty(); + } else { + this.emailAddressType = Optional.of(emailAddressType.get()); + } + 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.

            */ diff --git a/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java b/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java index 6c3af7c82..a28a1b4ea 100644 --- a/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java +++ b/src/main/java/com/merge/api/ats/types/EmailAddressRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,8 +50,11 @@ private EmailAddressRequest( /** * @return The email address. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -60,18 +66,51 @@ public Optional getValue() { *
          • OTHER - OTHER
          • *
          */ - @JsonProperty("email_address_type") + @JsonIgnore public Optional getEmailAddressType() { + if (emailAddressType == null) { + return Optional.empty(); + } return emailAddressType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address_type") + private Optional _getEmailAddressType() { + return emailAddressType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -144,6 +183,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

          The type of email address.

          *
            @@ -163,6 +213,17 @@ public Builder emailAddressType(EmailAddressRequestEmailAddressType emailAddress return this; } + public Builder emailAddressType(Nullable emailAddressType) { + if (emailAddressType.isNull()) { + this.emailAddressType = null; + } else if (emailAddressType.isEmpty()) { + this.emailAddressType = Optional.empty(); + } else { + this.emailAddressType = Optional.of(emailAddressType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -174,6 +235,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -185,6 +257,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public EmailAddressRequest build() { return new EmailAddressRequest( value, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); diff --git a/src/main/java/com/merge/api/ats/types/EncodingEnum.java b/src/main/java/com/merge/api/ats/types/EncodingEnum.java index aa22ce16e..48f28cc00 100644 --- a/src/main/java/com/merge/api/ats/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/ats/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } diff --git a/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java index f2845798c..52de87155 100644 --- a/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/ats/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
          • de - de
          • *
          */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

          */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

          */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

          */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

          */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

          The following subset of IETF language tags can be used to configure localization.

          *
            @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

            The boolean that indicates whether initial, periodic, and force syncs will be disabled.

            */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

            A JSON object containing integration-specific configuration options.

            */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

            A JSON object containing integration-specific configuration options.

            * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

            The following subset of IETF language tags can be used to configure localization.

            + *
              + *
            • en - en
            • + *
            • de - de
            • + *
            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

            The following subset of IETF language tags can be used to configure localization.

            *
              @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java index 1866b3629..716f961b3 100644 --- a/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/ats/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); } 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..9a1e7135a 100644 --- a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java index c75015f7b..27e8e2f02 100644 --- a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index f06617594..e3eebf03f 100644 --- a/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/ats/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/ats/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/ats/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..607393bda --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(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..f938cefd4 100644 --- a/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -51,11 +54,11 @@ public final class InterviewsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -74,9 +77,9 @@ private InterviewsListRequest( Optional modifiedBefore, Optional organizerId, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.applicationId = applicationId; @@ -214,15 +217,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -230,10 +236,16 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -326,11 +338,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -563,12 +575,12 @@ public Builder pageSize(Integer pageSize) { *

              Deprecated. Use show_enum_origins.

              */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(InterviewsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -587,16 +599,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(InterviewsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/InterviewsListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/InterviewsListRequestRemoteFields.java new file mode 100644 index 000000000..459930763 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 InterviewsListRequestRemoteFields { + public static final InterviewsListRequestRemoteFields STATUS = + new InterviewsListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + InterviewsListRequestRemoteFields(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 InterviewsListRequestRemoteFields + && this.string.equals(((InterviewsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InterviewsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new InterviewsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/InterviewsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/InterviewsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..decc20408 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 InterviewsListRequestShowEnumOrigins { + public static final InterviewsListRequestShowEnumOrigins STATUS = + new InterviewsListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + InterviewsListRequestShowEnumOrigins(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 InterviewsListRequestShowEnumOrigins + && this.string.equals(((InterviewsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InterviewsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new InterviewsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java index 678419832..0877a5693 100644 --- a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequest.java @@ -28,9 +28,9 @@ public final class InterviewsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -38,8 +38,8 @@ private InterviewsRetrieveRequest( Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -131,9 +131,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

              Deprecated. Use show_enum_origins.

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

              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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(InterviewsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..e38b4310a --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 InterviewsRetrieveRequestRemoteFields { + public static final InterviewsRetrieveRequestRemoteFields STATUS = + new InterviewsRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + InterviewsRetrieveRequestRemoteFields(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 InterviewsRetrieveRequestRemoteFields + && this.string.equals(((InterviewsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InterviewsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new InterviewsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..c74a8c5f9 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/InterviewsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 InterviewsRetrieveRequestShowEnumOrigins { + public static final InterviewsRetrieveRequestShowEnumOrigins STATUS = + new InterviewsRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + InterviewsRetrieveRequestShowEnumOrigins(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 InterviewsRetrieveRequestShowEnumOrigins + && this.string.equals(((InterviewsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static InterviewsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new InterviewsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/Issue.java b/src/main/java/com/merge/api/ats/types/Issue.java index 184d0987b..6279dbcc4 100644 --- a/src/main/java/com/merge/api/ats/types/Issue.java +++ b/src/main/java/com/merge/api/ats/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..cfcd406bd 100644 --- a/src/main/java/com/merge/api/ats/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

              If provided, will only return issues whose first incident time was before this datetime.

              */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

              If true, will include muted issues

              */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

              If provided, will only return issues whose last incident time was before this datetime.

              */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

              If provided, will only include issues pertaining to the linked account passed in.

              */ diff --git a/src/main/java/com/merge/api/ats/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..a14b54ca1 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ats/types/Job.java b/src/main/java/com/merge/api/ats/types/Job.java index c4927701c..f60e36d0c 100644 --- a/src/main/java/com/merge/api/ats/types/Job.java +++ b/src/main/java/com/merge/api/ats/types/Job.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -122,8 +125,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -146,24 +152,33 @@ public Optional getModifiedAt() { /** * @return The job's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The job's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The job's code. Typically an additional identifier used to reference the particular job that is displayed on the ATS. */ - @JsonProperty("code") + @JsonIgnore public Optional getCode() { + if (code == null) { + return Optional.empty(); + } return code; } @@ -177,8 +192,11 @@ public Optional getCode() { *
            • PENDING - PENDING
            • *
            */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -190,8 +208,11 @@ public Optional getStatus() { *
          • PROFILE - PROFILE
          • *
          */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -211,24 +232,33 @@ public Optional> getJobPostingUrls() { /** * @return When the third party's job was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's job was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return Whether the job is confidential. */ - @JsonProperty("confidential") + @JsonIgnore public Optional getConfidential() { + if (confidential == null) { + return Optional.empty(); + } return confidential; } @@ -272,13 +302,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("code") + private Optional _getCode() { + return code; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("confidential") + private Optional _getConfidential() { + return confidential; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -451,6 +553,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -493,6 +606,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The job's description.

          */ @@ -507,6 +631,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The job's code. Typically an additional identifier used to reference the particular job that is displayed on the ATS.

          */ @@ -521,6 +656,17 @@ public Builder code(String code) { return this; } + public Builder code(Nullable code) { + if (code.isNull()) { + this.code = null; + } else if (code.isEmpty()) { + this.code = Optional.empty(); + } else { + this.code = Optional.of(code.get()); + } + return this; + } + /** *

          The job's status.

          *
            @@ -542,6 +688,17 @@ public Builder status(JobStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

            The job's type.

            *
              @@ -561,6 +718,17 @@ public Builder type(JobType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

              IDs of JobPosting objects that serve as job postings for this Job.

              */ @@ -600,6 +768,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

              When the third party's job was updated.

              */ @@ -614,6 +793,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

              Whether the job is confidential.

              */ @@ -628,6 +818,17 @@ public Builder confidential(Boolean confidential) { return this; } + public Builder confidential(Nullable confidential) { + if (confidential.isNull()) { + this.confidential = null; + } else if (confidential.isEmpty()) { + this.confidential = Optional.empty(); + } else { + this.confidential = Optional.of(confidential.get()); + } + return this; + } + /** *

              IDs of Department objects for this Job.

              */ @@ -709,6 +910,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -720,6 +932,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Job build() { return new Job( id, diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStage.java b/src/main/java/com/merge/api/ats/types/JobInterviewStage.java index cf1f24bd7..ec3f59fee 100644 --- a/src/main/java/com/merge/api/ats/types/JobInterviewStage.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStage.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,24 +108,33 @@ public Optional getModifiedAt() { /** * @return Standard stage names are offered by ATS systems but can be modified by users. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return 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. */ - @JsonProperty("job") + @JsonIgnore public Optional getJob() { + if (job == null) { + return Optional.empty(); + } return job; } /** * @return 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. */ - @JsonProperty("stage_order") + @JsonIgnore public Optional getStageOrder() { + if (stageOrder == null) { + return Optional.empty(); + } return stageOrder; } @@ -131,13 +146,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job") + private Optional _getJob() { + return job; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stage_order") + private Optional _getStageOrder() { + return stageOrder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -255,6 +312,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

              The datetime that this object was created by Merge.

              */ @@ -297,6 +365,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

              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.

              */ @@ -311,6 +390,17 @@ public Builder job(JobInterviewStageJob job) { return this; } + public Builder job(Nullable job) { + if (job.isNull()) { + this.job = null; + } else if (job.isEmpty()) { + this.job = Optional.empty(); + } else { + this.job = Optional.of(job.get()); + } + return this; + } + /** *

              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.

              */ @@ -325,6 +415,17 @@ public Builder stageOrder(Integer stageOrder) { return this; } + public Builder stageOrder(Nullable stageOrder) { + if (stageOrder.isNull()) { + this.stageOrder = null; + } else if (stageOrder.isEmpty()) { + this.stageOrder = Optional.empty(); + } else { + this.stageOrder = Optional.of(stageOrder.get()); + } + 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.

              */ @@ -350,6 +451,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -361,6 +473,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public JobInterviewStage build() { return new JobInterviewStage( id, 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..6214d498f 100644 --- a/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobInterviewStagesListRequest.Builder.class) public final class JobInterviewStagesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class JobInterviewStagesListRequest { private final Map additionalProperties; private JobInterviewStagesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private JobInterviewStagesListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 createdAfter = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(JobInterviewStagesListRequest 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(JobInterviewStagesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public JobInterviewStagesListRequest build() { return new JobInterviewStagesListRequest( expand, diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequestExpandItem.java new file mode 100644 index 000000000..7cf197ab7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 JobInterviewStagesListRequestExpandItem { + public static final JobInterviewStagesListRequestExpandItem JOB = + new JobInterviewStagesListRequestExpandItem(Value.JOB, "job"); + + private final Value value; + + private final String string; + + JobInterviewStagesListRequestExpandItem(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 JobInterviewStagesListRequestExpandItem + && this.string.equals(((JobInterviewStagesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case JOB: + return visitor.visitJob(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobInterviewStagesListRequestExpandItem valueOf(String value) { + switch (value) { + case "job": + return JOB; + default: + return new JobInterviewStagesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + JOB, + + UNKNOWN + } + + public interface Visitor { + T visitJob(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java index a83c23de7..48586b8b1 100644 --- a/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobInterviewStagesRetrieveRequest.Builder.class) public final class JobInterviewStagesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class JobInterviewStagesRetrieveRequest { private final Map additionalProperties; private JobInterviewStagesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private JobInterviewStagesRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(JobInterviewStagesRetrieveRequest 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(JobInterviewStagesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..227ed17a7 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobInterviewStagesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 JobInterviewStagesRetrieveRequestExpandItem { + public static final JobInterviewStagesRetrieveRequestExpandItem JOB = + new JobInterviewStagesRetrieveRequestExpandItem(Value.JOB, "job"); + + private final Value value; + + private final String string; + + JobInterviewStagesRetrieveRequestExpandItem(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 JobInterviewStagesRetrieveRequestExpandItem + && this.string.equals(((JobInterviewStagesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case JOB: + return visitor.visitJob(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobInterviewStagesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "job": + return JOB; + default: + return new JobInterviewStagesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + JOB, + + UNKNOWN + } + + public interface Visitor { + T visitJob(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobPosting.java b/src/main/java/com/merge/api/ats/types/JobPosting.java index 63b9477cc..b8b86e3f7 100644 --- a/src/main/java/com/merge/api/ats/types/JobPosting.java +++ b/src/main/java/com/merge/api/ats/types/JobPosting.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -98,8 +101,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -122,8 +128,11 @@ public Optional getModifiedAt() { /** * @return The job posting’s title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } @@ -138,8 +147,11 @@ public Optional> getJobPostingUrls() { /** * @return ID of Job object for this JobPosting. */ - @JsonProperty("job") + @JsonIgnore public Optional getJob() { + if (job == null) { + return Optional.empty(); + } return job; } @@ -153,40 +165,55 @@ public Optional getJob() { *
            • PENDING - PENDING
            • *
            */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The job posting’s content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return When the third party's job posting was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's job posting was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return Indicates whether the job posting is internal or external. */ - @JsonProperty("is_internal") + @JsonIgnore public Optional getIsInternal() { + if (isInternal == null) { + return Optional.empty(); + } return isInternal; } @@ -198,13 +225,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job") + private Optional _getJob() { + return job; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_internal") + private Optional _getIsInternal() { + return isInternal; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -347,6 +440,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -389,6 +493,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

            The Url object is used to represent hyperlinks for a candidate to apply to a given job.

            */ @@ -417,6 +532,17 @@ public Builder job(JobPostingJob job) { return this; } + public Builder job(Nullable job) { + if (job.isNull()) { + this.job = null; + } else if (job.isEmpty()) { + this.job = Optional.empty(); + } else { + this.job = Optional.of(job.get()); + } + return this; + } + /** *

            The job posting's status.

            *
              @@ -438,6 +564,17 @@ public Builder status(JobPostingStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

              The job posting’s content.

              */ @@ -452,6 +589,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

              When the third party's job posting was created.

              */ @@ -466,6 +614,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

              When the third party's job posting was updated.

              */ @@ -480,6 +639,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

              Indicates whether the job posting is internal or external.

              */ @@ -494,6 +664,17 @@ public Builder isInternal(Boolean isInternal) { return this; } + public Builder isInternal(Nullable isInternal) { + if (isInternal.isNull()) { + this.isInternal = null; + } else if (isInternal.isEmpty()) { + this.isInternal = Optional.empty(); + } else { + this.isInternal = Optional.of(isInternal.get()); + } + 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.

              */ @@ -519,6 +700,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -530,6 +722,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public JobPosting build() { return new JobPosting( id, 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..8a4d8f5b9 100644 --- a/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobPostingsListRequest.Builder.class) public final class JobPostingsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class JobPostingsListRequest { private final Map additionalProperties; private JobPostingsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private JobPostingsListRequest( * @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; } @@ -161,8 +164,11 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -176,8 +182,23 @@ public Optional getRemoteId() { *
            • PENDING - PENDING
            • *
            */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -235,7 +256,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 createdAfter = Optional.empty(); @@ -284,17 +305,17 @@ public Builder from(JobPostingsListRequest 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(JobPostingsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -439,6 +460,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            If provided, will only return Job Postings with this status. Options: ('PUBLISHED', 'CLOSED', 'DRAFT', 'INTERNAL', 'PENDING')

            *
              @@ -460,6 +492,17 @@ public Builder status(JobPostingsListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public JobPostingsListRequest build() { return new JobPostingsListRequest( expand, diff --git a/src/main/java/com/merge/api/ats/types/JobPostingsListRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobPostingsListRequestExpandItem.java new file mode 100644 index 000000000..c8616bc9e --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobPostingsListRequestExpandItem.java @@ -0,0 +1,74 @@ +/** + * 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 JobPostingsListRequestExpandItem { + public static final JobPostingsListRequestExpandItem JOB = new JobPostingsListRequestExpandItem(Value.JOB, "job"); + + private final Value value; + + private final String string; + + JobPostingsListRequestExpandItem(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 JobPostingsListRequestExpandItem + && this.string.equals(((JobPostingsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case JOB: + return visitor.visitJob(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobPostingsListRequestExpandItem valueOf(String value) { + switch (value) { + case "job": + return JOB; + default: + return new JobPostingsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + JOB, + + UNKNOWN + } + + public interface Visitor { + T visitJob(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java index 8fd3a8730..9e7fdb53e 100644 --- a/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = JobPostingsRetrieveRequest.Builder.class) public final class JobPostingsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class JobPostingsRetrieveRequest { private final Map additionalProperties; private JobPostingsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private JobPostingsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(JobPostingsRetrieveRequest 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(JobPostingsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..5098cc40b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobPostingsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 JobPostingsRetrieveRequestExpandItem { + public static final JobPostingsRetrieveRequestExpandItem JOB = + new JobPostingsRetrieveRequestExpandItem(Value.JOB, "job"); + + private final Value value; + + private final String string; + + JobPostingsRetrieveRequestExpandItem(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 JobPostingsRetrieveRequestExpandItem + && this.string.equals(((JobPostingsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case JOB: + return visitor.visitJob(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobPostingsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "job": + return JOB; + default: + return new JobPostingsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + JOB, + + UNKNOWN + } + + public interface Visitor { + T visitJob(); + + T visitUnknown(String unknownType); + } +} 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..a82e21390 100644 --- a/src/main/java/com/merge/api/ats/types/JobsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -47,11 +50,11 @@ public final class JobsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional status; @@ -70,9 +73,9 @@ private JobsListRequest( Optional modifiedBefore, Optional offices, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional status, Map additionalProperties) { this.expand = expand; @@ -105,8 +108,11 @@ public Optional> getExpand() { /** * @return If provided, will only return jobs with this code. */ - @JsonProperty("code") + @JsonIgnore public Optional getCode() { + if (code == null) { + return Optional.empty(); + } return code; } @@ -194,15 +200,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -210,7 +219,7 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -224,8 +233,29 @@ public Optional getShowEnumOrigins() { *
            • PENDING - PENDING
            • *
            */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("code") + private Optional _getCode() { + return code; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -315,11 +345,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional status = Optional.empty(); @@ -381,6 +411,17 @@ public Builder code(String code) { return this; } + public Builder code(Nullable code) { + if (code.isNull()) { + this.code = null; + } else if (code.isEmpty()) { + this.code = Optional.empty(); + } else { + this.code = Optional.of(code.get()); + } + return this; + } + /** *

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

            */ @@ -525,12 +566,12 @@ public Builder pageSize(Integer pageSize) { *

            Deprecated. Use show_enum_origins.

            */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(JobsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -549,16 +590,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(JobsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } @@ -584,6 +636,17 @@ public Builder status(JobsListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public JobsListRequest build() { return new JobsListRequest( expand, diff --git a/src/main/java/com/merge/api/ats/types/JobsListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/JobsListRequestRemoteFields.java new file mode 100644 index 000000000..30e07131f --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsListRequestRemoteFields.java @@ -0,0 +1,74 @@ +/** + * 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 JobsListRequestRemoteFields { + public static final JobsListRequestRemoteFields STATUS = new JobsListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + JobsListRequestRemoteFields(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 JobsListRequestRemoteFields + && this.string.equals(((JobsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new JobsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/JobsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..7a2ec930d --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 JobsListRequestShowEnumOrigins { + public static final JobsListRequestShowEnumOrigins STATUS = + new JobsListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + JobsListRequestShowEnumOrigins(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 JobsListRequestShowEnumOrigins + && this.string.equals(((JobsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new JobsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java index 732f006f6..28fefa23d 100644 --- a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequest.java @@ -28,9 +28,9 @@ public final class JobsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -38,8 +38,8 @@ private JobsRetrieveRequest( Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -131,9 +131,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

            Deprecated. Use show_enum_origins.

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

            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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(JobsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..57e82e76b --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 JobsRetrieveRequestRemoteFields { + public static final JobsRetrieveRequestRemoteFields STATUS = + new JobsRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + JobsRetrieveRequestRemoteFields(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 JobsRetrieveRequestRemoteFields + && this.string.equals(((JobsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new JobsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..f850df9fb --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/JobsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 JobsRetrieveRequestShowEnumOrigins { + public static final JobsRetrieveRequestShowEnumOrigins STATUS = + new JobsRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + JobsRetrieveRequestShowEnumOrigins(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 JobsRetrieveRequestShowEnumOrigins + && this.string.equals(((JobsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static JobsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new JobsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} 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..394eed4d7 100644 --- a/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
          • filestorage - filestorage
          • *
          */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

          The pagination cursor value.

          */ diff --git a/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java index 41093f1d3..6004aa072 100644 --- a/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/ats/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -72,24 +75,51 @@ public String getData() { *
        • GZIP_BASE64 - GZIP_BASE64
        • *
        */ - @JsonProperty("encoding") + @JsonIgnore public Optional getEncoding() { + if (encoding == null) { + return Optional.empty(); + } return encoding; } /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encoding") + private Optional _getEncoding() { + return encoding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -157,6 +187,8 @@ public interface _FinalStage { _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + _FinalStage encoding(Nullable encoding); + /** *

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

        */ @@ -164,12 +196,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

        The MIME type of the file, if the field is for a file.

        */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +259,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +295,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. @@ -263,6 +331,27 @@ public _FinalStage fileName(Optional fileName) { return this; } + /** + *

        The encoding of the value of data. Defaults to RAW if not defined.

        + *
          + *
        • RAW - RAW
        • + *
        • BASE64 - BASE64
        • + *
        • GZIP_BASE64 - GZIP_BASE64
        • + *
        + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(Nullable encoding) { + if (encoding.isNull()) { + this.encoding = null; + } else if (encoding.isEmpty()) { + this.encoding = Optional.empty(); + } else { + this.encoding = Optional.of(encoding.get()); + } + return this; + } + /** *

        The encoding of the value of data. Defaults to RAW if not defined.

        *
          diff --git a/src/main/java/com/merge/api/ats/types/Offer.java b/src/main/java/com/merge/api/ats/types/Offer.java index 71d856280..a0f08a6a7 100644 --- a/src/main/java/com/merge/api/ats/types/Offer.java +++ b/src/main/java/com/merge/api/ats/types/Offer.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -94,8 +97,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -118,48 +124,66 @@ public Optional getModifiedAt() { /** * @return The application who is receiving the offer. */ - @JsonProperty("application") + @JsonIgnore public Optional getApplication() { + if (application == null) { + return Optional.empty(); + } return application; } /** * @return The user who created the offer. */ - @JsonProperty("creator") + @JsonIgnore public Optional getCreator() { + if (creator == null) { + return Optional.empty(); + } return creator; } /** * @return When the third party's offer was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the offer was closed. */ - @JsonProperty("closed_at") + @JsonIgnore public Optional getClosedAt() { + if (closedAt == null) { + return Optional.empty(); + } return closedAt; } /** * @return When the offer was sent. */ - @JsonProperty("sent_at") + @JsonIgnore public Optional getSentAt() { + if (sentAt == null) { + return Optional.empty(); + } return sentAt; } /** * @return The employment start date on the offer. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } @@ -177,8 +201,11 @@ public Optional getStartDate() { *
        • DEPRECATED - DEPRECATED
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -190,13 +217,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("application") + private Optional _getApplication() { + return application; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("creator") + private Optional _getCreator() { + return creator; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("closed_at") + private Optional _getClosedAt() { + return closedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("sent_at") + private Optional _getSentAt() { + return sentAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -334,6 +427,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -376,6 +480,17 @@ public Builder application(OfferApplication application) { return this; } + public Builder application(Nullable application) { + if (application.isNull()) { + this.application = null; + } else if (application.isEmpty()) { + this.application = Optional.empty(); + } else { + this.application = Optional.of(application.get()); + } + return this; + } + /** *

        The user who created the offer.

        */ @@ -390,6 +505,17 @@ public Builder creator(OfferCreator creator) { return this; } + public Builder creator(Nullable creator) { + if (creator.isNull()) { + this.creator = null; + } else if (creator.isEmpty()) { + this.creator = Optional.empty(); + } else { + this.creator = Optional.of(creator.get()); + } + return this; + } + /** *

        When the third party's offer was created.

        */ @@ -404,6 +530,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the offer was closed.

        */ @@ -418,6 +555,17 @@ public Builder closedAt(OffsetDateTime closedAt) { return this; } + public Builder closedAt(Nullable closedAt) { + if (closedAt.isNull()) { + this.closedAt = null; + } else if (closedAt.isEmpty()) { + this.closedAt = Optional.empty(); + } else { + this.closedAt = Optional.of(closedAt.get()); + } + return this; + } + /** *

        When the offer was sent.

        */ @@ -432,6 +580,17 @@ public Builder sentAt(OffsetDateTime sentAt) { return this; } + public Builder sentAt(Nullable sentAt) { + if (sentAt.isNull()) { + this.sentAt = null; + } else if (sentAt.isEmpty()) { + this.sentAt = Optional.empty(); + } else { + this.sentAt = Optional.of(sentAt.get()); + } + return this; + } + /** *

        The employment start date on the offer.

        */ @@ -446,6 +605,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

        The offer's status.

        *
          @@ -471,6 +641,17 @@ public Builder status(OfferStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + 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.

          */ @@ -496,6 +677,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -507,6 +699,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Offer build() { return new Offer( id, 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..d0c5aff23 100644 --- a/src/main/java/com/merge/api/ats/types/OffersListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OffersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -47,11 +50,11 @@ public final class OffersListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -68,9 +71,9 @@ private OffersListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.applicationId = applicationId; @@ -190,15 +193,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -206,10 +212,16 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -294,11 +306,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -501,12 +513,12 @@ public Builder pageSize(Integer pageSize) { *

          Deprecated. Use show_enum_origins.

          */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(OffersListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -525,16 +537,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(OffersListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/OffersListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/OffersListRequestRemoteFields.java new file mode 100644 index 000000000..5a7a35dee --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 OffersListRequestRemoteFields { + public static final OffersListRequestRemoteFields STATUS = + new OffersListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OffersListRequestRemoteFields(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 OffersListRequestRemoteFields + && this.string.equals(((OffersListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OffersListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OffersListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/OffersListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/OffersListRequestShowEnumOrigins.java new file mode 100644 index 000000000..b4be5fdcf --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 OffersListRequestShowEnumOrigins { + public static final OffersListRequestShowEnumOrigins STATUS = + new OffersListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OffersListRequestShowEnumOrigins(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 OffersListRequestShowEnumOrigins + && this.string.equals(((OffersListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OffersListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OffersListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java index 89a7bb0f1..b8827b155 100644 --- a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequest.java @@ -28,9 +28,9 @@ public final class OffersRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -38,8 +38,8 @@ private OffersRetrieveRequest( Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -131,9 +131,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

          Deprecated. Use show_enum_origins.

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

          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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(OffersRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..7716945b5 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 OffersRetrieveRequestRemoteFields { + public static final OffersRetrieveRequestRemoteFields STATUS = + new OffersRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OffersRetrieveRequestRemoteFields(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 OffersRetrieveRequestRemoteFields + && this.string.equals(((OffersRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OffersRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OffersRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..8431c4f88 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/OffersRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 OffersRetrieveRequestShowEnumOrigins { + public static final OffersRetrieveRequestShowEnumOrigins STATUS = + new OffersRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OffersRetrieveRequestShowEnumOrigins(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 OffersRetrieveRequestShowEnumOrigins + && this.string.equals(((OffersRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OffersRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OffersRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/Office.java b/src/main/java/com/merge/api/ats/types/Office.java index 92ef9013f..46c9d72f3 100644 --- a/src/main/java/com/merge/api/ats/types/Office.java +++ b/src/main/java/com/merge/api/ats/types/Office.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,16 +104,22 @@ public Optional getModifiedAt() { /** * @return The office's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The office's location. */ - @JsonProperty("location") + @JsonIgnore public Optional getLocation() { + if (location == null) { + return Optional.empty(); + } return location; } @@ -119,13 +131,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location") + private Optional _getLocation() { + return location; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -238,6 +286,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -280,6 +339,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The office's location.

          */ @@ -294,6 +364,17 @@ public Builder location(String location) { return this; } + public Builder location(Nullable location) { + if (location.isNull()) { + this.location = null; + } else if (location.isEmpty()) { + this.location = Optional.empty(); + } else { + this.location = Optional.of(location.get()); + } + 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.

          */ @@ -319,6 +400,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -330,6 +422,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Office build() { return new Office( id, 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..1881a729a 100644 --- a/src/main/java/com/merge/api/ats/types/OfficesListRequest.java +++ b/src/main/java/com/merge/api/ats/types/OfficesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public OfficesListRequest build() { return new OfficesListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java index bf2b08937..21dfbd88d 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java b/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java index 04986ba09..1f62aa06a 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedActivityList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedActivityList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java b/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java index d1ba81129..96bcdad60 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedApplicationList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedApplicationList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java index 15f08bbca..e85e1d621 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedAttachmentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAttachmentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java index 3bb1d6c74..737149269 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java b/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java index 59a70a382..51784fdcd 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedCandidateList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCandidateList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java b/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java index dfddcec7e..a7d13a911 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedDepartmentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedDepartmentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java b/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java index cda0d3bf1..cc1783c1a 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedEeocList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEeocList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java b/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java index 272624016..d6abcfb78 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java index 30bde6ae0..6f8032ec1 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobInterviewStageList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedJobInterviewStageList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedJobList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobList.java index 65a2973b8..15e24940b 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedJobList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedJobList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java b/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java index 3feb7ee69..81c5994ce 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedJobPostingList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedJobPostingList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java b/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java index ac648bb45..ba08f6c96 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedOfferList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedOfferList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java b/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java index b5140f1cc..4eb087427 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedOfficeList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedOfficeList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java b/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java index cd3dc5429..8cf1cad58 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedRejectReasonList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRejectReasonList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java b/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java index 6c18136e1..1073f5496 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedRemoteUserList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRemoteUserList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java b/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java index 66489d1b4..872277270 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScheduledInterviewList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedScheduledInterviewList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java b/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java index cea5681d9..85bfe839d 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScorecardList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedScorecardList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java b/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java index 83991e4f1..a87220791 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedScreeningQuestionList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedScreeningQuestionList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java index b479353aa..43b6a2f82 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PaginatedTagList.java b/src/main/java/com/merge/api/ats/types/PaginatedTagList.java index 9a3609cb4..35c880a26 100644 --- a/src/main/java/com/merge/api/ats/types/PaginatedTagList.java +++ b/src/main/java/com/merge/api/ats/types/PaginatedTagList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTagList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java b/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java index 706ee2fd4..91d54ba02 100644 --- a/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java +++ b/src/main/java/com/merge/api/ats/types/PatchedCandidateRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -101,64 +104,88 @@ private PatchedCandidateRequest( /** * @return The candidate's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The candidate's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The candidate's current company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The candidate's current title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } /** * @return When the most recent interaction with the candidate occurred. */ - @JsonProperty("last_interaction_at") + @JsonIgnore public Optional getLastInteractionAt() { + if (lastInteractionAt == null) { + return Optional.empty(); + } return lastInteractionAt; } /** * @return Whether or not the candidate is private. */ - @JsonProperty("is_private") + @JsonIgnore public Optional getIsPrivate() { + if (isPrivate == null) { + return Optional.empty(); + } return isPrivate; } /** * @return Whether or not the candidate can be emailed. */ - @JsonProperty("can_email") + @JsonIgnore public Optional getCanEmail() { + if (canEmail == null) { + return Optional.empty(); + } return canEmail; } /** * @return The candidate's locations. */ - @JsonProperty("locations") + @JsonIgnore public Optional>> getLocations() { + if (locations == null) { + return Optional.empty(); + } return locations; } @@ -201,18 +228,93 @@ public Optional>> getAttachments() { return attachments; } - @JsonProperty("remote_template_id") + @JsonIgnore public Optional getRemoteTemplateId() { + if (remoteTemplateId == null) { + return Optional.empty(); + } return remoteTemplateId; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_interaction_at") + private Optional _getLastInteractionAt() { + return lastInteractionAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_private") + private Optional _getIsPrivate() { + return isPrivate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("can_email") + private Optional _getCanEmail() { + return canEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("locations") + private Optional>> _getLocations() { + return locations; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_template_id") + private Optional _getRemoteTemplateId() { + return remoteTemplateId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -354,6 +456,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The candidate's last name.

          */ @@ -368,6 +481,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

          The candidate's current company.

          */ @@ -382,6 +506,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The candidate's current title.

          */ @@ -396,6 +531,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

          When the most recent interaction with the candidate occurred.

          */ @@ -410,6 +556,17 @@ public Builder lastInteractionAt(OffsetDateTime lastInteractionAt) { return this; } + public Builder lastInteractionAt(Nullable lastInteractionAt) { + if (lastInteractionAt.isNull()) { + this.lastInteractionAt = null; + } else if (lastInteractionAt.isEmpty()) { + this.lastInteractionAt = Optional.empty(); + } else { + this.lastInteractionAt = Optional.of(lastInteractionAt.get()); + } + return this; + } + /** *

          Whether or not the candidate is private.

          */ @@ -424,6 +581,17 @@ public Builder isPrivate(Boolean isPrivate) { return this; } + public Builder isPrivate(Nullable isPrivate) { + if (isPrivate.isNull()) { + this.isPrivate = null; + } else if (isPrivate.isEmpty()) { + this.isPrivate = Optional.empty(); + } else { + this.isPrivate = Optional.of(isPrivate.get()); + } + return this; + } + /** *

          Whether or not the candidate can be emailed.

          */ @@ -438,6 +606,17 @@ public Builder canEmail(Boolean canEmail) { return this; } + public Builder canEmail(Nullable canEmail) { + if (canEmail.isNull()) { + this.canEmail = null; + } else if (canEmail.isEmpty()) { + this.canEmail = Optional.empty(); + } else { + this.canEmail = Optional.of(canEmail.get()); + } + return this; + } + /** *

          The candidate's locations.

          */ @@ -452,6 +631,17 @@ public Builder locations(List> locations) { return this; } + public Builder locations(Nullable>> locations) { + if (locations.isNull()) { + this.locations = null; + } else if (locations.isEmpty()) { + this.locations = Optional.empty(); + } else { + this.locations = Optional.of(locations.get()); + } + return this; + } + @JsonSetter(value = "phone_numbers", nulls = Nulls.SKIP) public Builder phoneNumbers(Optional> phoneNumbers) { this.phoneNumbers = phoneNumbers; @@ -538,6 +728,17 @@ public Builder remoteTemplateId(String remoteTemplateId) { return this; } + public Builder remoteTemplateId(Nullable remoteTemplateId) { + if (remoteTemplateId.isNull()) { + this.remoteTemplateId = null; + } else if (remoteTemplateId.isEmpty()) { + this.remoteTemplateId = Optional.empty(); + } else { + this.remoteTemplateId = Optional.of(remoteTemplateId.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -549,6 +750,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -560,6 +772,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public PatchedCandidateRequest build() { return new PatchedCandidateRequest( firstName, diff --git a/src/main/java/com/merge/api/ats/types/PhoneNumber.java b/src/main/java/com/merge/api/ats/types/PhoneNumber.java index 500cd1ff6..bd4a7b25b 100644 --- a/src/main/java/com/merge/api/ats/types/PhoneNumber.java +++ b/src/main/java/com/merge/api/ats/types/PhoneNumber.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -67,8 +70,11 @@ public Optional getModifiedAt() { /** * @return The phone number. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -82,8 +88,11 @@ public Optional getValue() { *
        • OTHER - OTHER
        • *
        */ - @JsonProperty("phone_number_type") + @JsonIgnore public Optional getPhoneNumberType() { + if (phoneNumberType == null) { + return Optional.empty(); + } return phoneNumberType; } @@ -95,6 +104,18 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number_type") + private Optional _getPhoneNumberType() { + return phoneNumberType; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -196,6 +217,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

        The type of phone number.

        *
          @@ -217,6 +249,17 @@ public Builder phoneNumberType(PhoneNumberPhoneNumberType phoneNumberType) { return this; } + public Builder phoneNumberType(Nullable phoneNumberType) { + if (phoneNumberType.isNull()) { + this.phoneNumberType = null; + } else if (phoneNumberType.isEmpty()) { + this.phoneNumberType = Optional.empty(); + } else { + this.phoneNumberType = Optional.of(phoneNumberType.get()); + } + 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.

          */ diff --git a/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java index 4da4ebb9a..32944ed9f 100644 --- a/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java +++ b/src/main/java/com/merge/api/ats/types/PhoneNumberRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,8 +50,11 @@ private PhoneNumberRequest( /** * @return The phone number. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -62,18 +68,51 @@ public Optional getValue() { *
        • OTHER - OTHER
        • *
        */ - @JsonProperty("phone_number_type") + @JsonIgnore public Optional getPhoneNumberType() { + if (phoneNumberType == null) { + return Optional.empty(); + } return phoneNumberType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number_type") + private Optional _getPhoneNumberType() { + return phoneNumberType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -146,6 +185,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

        The type of phone number.

        *
          @@ -167,6 +217,17 @@ public Builder phoneNumberType(PhoneNumberRequestPhoneNumberType phoneNumberType return this; } + public Builder phoneNumberType(Nullable phoneNumberType) { + if (phoneNumberType.isNull()) { + this.phoneNumberType = null; + } else if (phoneNumberType.isEmpty()) { + this.phoneNumberType = Optional.empty(); + } else { + this.phoneNumberType = Optional.of(phoneNumberType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -178,6 +239,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -189,6 +261,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public PhoneNumberRequest build() { return new PhoneNumberRequest( value, phoneNumberType, integrationParams, linkedAccountParams, additionalProperties); diff --git a/src/main/java/com/merge/api/ats/types/RejectReason.java b/src/main/java/com/merge/api/ats/types/RejectReason.java index 1a69dcbc1..b5614713b 100644 --- a/src/main/java/com/merge/api/ats/types/RejectReason.java +++ b/src/main/java/com/merge/api/ats/types/RejectReason.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -70,8 +73,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -94,8 +100,11 @@ public Optional getModifiedAt() { /** * @return The rejection reason’s name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -107,13 +116,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -221,6 +260,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -263,6 +313,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + 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.

          */ @@ -288,6 +349,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -299,6 +371,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public RejectReason build() { return new RejectReason( id, 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..94b00ac37 100644 --- a/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/RejectReasonsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public RejectReasonsListRequest build() { return new RejectReasonsListRequest( createdAfter, 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/RemoteFieldApi.java b/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java index 40a032021..24fd4a86f 100644 --- a/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/ats/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); diff --git a/src/main/java/com/merge/api/ats/types/RemoteUser.java b/src/main/java/com/merge/api/ats/types/RemoteUser.java index 58797d881..487827efc 100644 --- a/src/main/java/com/merge/api/ats/types/RemoteUser.java +++ b/src/main/java/com/merge/api/ats/types/RemoteUser.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,40 +120,55 @@ public Optional getModifiedAt() { /** * @return The user's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The user's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The user's email. */ - @JsonProperty("email") + @JsonIgnore public Optional getEmail() { + if (email == null) { + return Optional.empty(); + } return email; } /** * @return Whether the user's account had been disabled. */ - @JsonProperty("disabled") + @JsonIgnore public Optional getDisabled() { + if (disabled == null) { + return Optional.empty(); + } return disabled; } /** * @return When the third party's user was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -161,8 +182,11 @@ public Optional getRemoteCreatedAt() { *
        • INTERVIEWER - INTERVIEWER
        • *
        */ - @JsonProperty("access_role") + @JsonIgnore public Optional getAccessRole() { + if (accessRole == null) { + return Optional.empty(); + } return accessRole; } @@ -174,13 +198,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + private Optional _getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("disabled") + private Optional _getDisabled() { + return disabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("access_role") + private Optional _getAccessRole() { + return accessRole; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -313,6 +397,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -355,6 +450,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

        The user's last name.

        */ @@ -369,6 +475,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

        The user's email.

        */ @@ -383,6 +500,17 @@ public Builder email(String email) { return this; } + public Builder email(Nullable email) { + if (email.isNull()) { + this.email = null; + } else if (email.isEmpty()) { + this.email = Optional.empty(); + } else { + this.email = Optional.of(email.get()); + } + return this; + } + /** *

        Whether the user's account had been disabled.

        */ @@ -397,6 +525,17 @@ public Builder disabled(Boolean disabled) { return this; } + public Builder disabled(Nullable disabled) { + if (disabled.isNull()) { + this.disabled = null; + } else if (disabled.isEmpty()) { + this.disabled = Optional.empty(); + } else { + this.disabled = Optional.of(disabled.get()); + } + return this; + } + /** *

        When the third party's user was created.

        */ @@ -411,6 +550,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        The user's role.

        *
          @@ -432,6 +582,17 @@ public Builder accessRole(RemoteUserAccessRole accessRole) { return this; } + public Builder accessRole(Nullable accessRole) { + if (accessRole.isNull()) { + this.accessRole = null; + } else if (accessRole.isEmpty()) { + this.accessRole = Optional.empty(); + } else { + this.accessRole = Optional.of(accessRole.get()); + } + 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.

          */ @@ -457,6 +618,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -468,6 +640,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public RemoteUser build() { return new RemoteUser( id, diff --git a/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java index 97232c03e..cc0667bcd 100644 --- a/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/ats/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/ats/types/ScheduledInterview.java b/src/main/java/com/merge/api/ats/types/ScheduledInterview.java index 36151ddc8..2601dad87 100644 --- a/src/main/java/com/merge/api/ats/types/ScheduledInterview.java +++ b/src/main/java/com/merge/api/ats/types/ScheduledInterview.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,24 +136,33 @@ public Optional getModifiedAt() { /** * @return The application being interviewed. */ - @JsonProperty("application") + @JsonIgnore public Optional getApplication() { + if (application == null) { + return Optional.empty(); + } return application; } /** * @return The stage of the interview. */ - @JsonProperty("job_interview_stage") + @JsonIgnore public Optional getJobInterviewStage() { + if (jobInterviewStage == null) { + return Optional.empty(); + } return jobInterviewStage; } /** * @return The user organizing the interview. */ - @JsonProperty("organizer") + @JsonIgnore public Optional getOrganizer() { + if (organizer == null) { + return Optional.empty(); + } return organizer; } @@ -162,40 +177,55 @@ public Optional>> getInterview /** * @return The interview's location. */ - @JsonProperty("location") + @JsonIgnore public Optional getLocation() { + if (location == null) { + return Optional.empty(); + } return location; } /** * @return When the interview was started. */ - @JsonProperty("start_at") + @JsonIgnore public Optional getStartAt() { + if (startAt == null) { + return Optional.empty(); + } return startAt; } /** * @return When the interview was ended. */ - @JsonProperty("end_at") + @JsonIgnore public Optional getEndAt() { + if (endAt == null) { + return Optional.empty(); + } return endAt; } /** * @return When the third party's interview was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's interview was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -207,8 +237,11 @@ public Optional getRemoteUpdatedAt() { *
        • COMPLETE - COMPLETE
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -220,13 +253,91 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("application") + private Optional _getApplication() { + return application; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job_interview_stage") + private Optional _getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organizer") + private Optional _getOrganizer() { + return organizer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location") + private Optional _getLocation() { + return location; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_at") + private Optional _getStartAt() { + return startAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_at") + private Optional _getEndAt() { + return endAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -379,6 +490,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -421,6 +543,17 @@ public Builder application(ScheduledInterviewApplication application) { return this; } + public Builder application(Nullable application) { + if (application.isNull()) { + this.application = null; + } else if (application.isEmpty()) { + this.application = Optional.empty(); + } else { + this.application = Optional.of(application.get()); + } + return this; + } + /** *

        The stage of the interview.

        */ @@ -435,6 +568,17 @@ public Builder jobInterviewStage(ScheduledInterviewJobInterviewStage jobIntervie return this; } + public Builder jobInterviewStage(Nullable jobInterviewStage) { + if (jobInterviewStage.isNull()) { + this.jobInterviewStage = null; + } else if (jobInterviewStage.isEmpty()) { + this.jobInterviewStage = Optional.empty(); + } else { + this.jobInterviewStage = Optional.of(jobInterviewStage.get()); + } + return this; + } + /** *

        The user organizing the interview.

        */ @@ -449,6 +593,17 @@ public Builder organizer(ScheduledInterviewOrganizer organizer) { return this; } + public Builder organizer(Nullable organizer) { + if (organizer.isNull()) { + this.organizer = null; + } else if (organizer.isEmpty()) { + this.organizer = Optional.empty(); + } else { + this.organizer = Optional.of(organizer.get()); + } + return this; + } + /** *

        Array of RemoteUser IDs.

        */ @@ -477,6 +632,17 @@ public Builder location(String location) { return this; } + public Builder location(Nullable location) { + if (location.isNull()) { + this.location = null; + } else if (location.isEmpty()) { + this.location = Optional.empty(); + } else { + this.location = Optional.of(location.get()); + } + return this; + } + /** *

        When the interview was started.

        */ @@ -491,6 +657,17 @@ public Builder startAt(OffsetDateTime startAt) { return this; } + public Builder startAt(Nullable startAt) { + if (startAt.isNull()) { + this.startAt = null; + } else if (startAt.isEmpty()) { + this.startAt = Optional.empty(); + } else { + this.startAt = Optional.of(startAt.get()); + } + return this; + } + /** *

        When the interview was ended.

        */ @@ -505,6 +682,17 @@ public Builder endAt(OffsetDateTime endAt) { return this; } + public Builder endAt(Nullable endAt) { + if (endAt.isNull()) { + this.endAt = null; + } else if (endAt.isEmpty()) { + this.endAt = Optional.empty(); + } else { + this.endAt = Optional.of(endAt.get()); + } + return this; + } + /** *

        When the third party's interview was created.

        */ @@ -519,6 +707,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the third party's interview was updated.

        */ @@ -533,6 +732,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

        The interview's status.

        *
          @@ -552,6 +762,17 @@ public Builder status(ScheduledInterviewStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + 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.

          */ @@ -577,6 +798,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -588,6 +820,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public ScheduledInterview build() { return new ScheduledInterview( id, diff --git a/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequest.java b/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequest.java index cfcfbde96..842ea31e8 100644 --- a/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScheduledInterviewRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -73,24 +76,33 @@ private ScheduledInterviewRequest( /** * @return The application being interviewed. */ - @JsonProperty("application") + @JsonIgnore public Optional getApplication() { + if (application == null) { + return Optional.empty(); + } return application; } /** * @return The stage of the interview. */ - @JsonProperty("job_interview_stage") + @JsonIgnore public Optional getJobInterviewStage() { + if (jobInterviewStage == null) { + return Optional.empty(); + } return jobInterviewStage; } /** * @return The user organizing the interview. */ - @JsonProperty("organizer") + @JsonIgnore public Optional getOrganizer() { + if (organizer == null) { + return Optional.empty(); + } return organizer; } @@ -105,24 +117,33 @@ public Optional>> getIn /** * @return The interview's location. */ - @JsonProperty("location") + @JsonIgnore public Optional getLocation() { + if (location == null) { + return Optional.empty(); + } return location; } /** * @return When the interview was started. */ - @JsonProperty("start_at") + @JsonIgnore public Optional getStartAt() { + if (startAt == null) { + return Optional.empty(); + } return startAt; } /** * @return When the interview was ended. */ - @JsonProperty("end_at") + @JsonIgnore public Optional getEndAt() { + if (endAt == null) { + return Optional.empty(); + } return endAt; } @@ -134,18 +155,81 @@ public Optional getEndAt() { *
        • COMPLETE - COMPLETE
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("application") + private Optional _getApplication() { + return application; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job_interview_stage") + private Optional _getJobInterviewStage() { + return jobInterviewStage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("organizer") + private Optional _getOrganizer() { + return organizer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location") + private Optional _getLocation() { + return location; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_at") + private Optional _getStartAt() { + return startAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_at") + private Optional _getEndAt() { + return endAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -252,6 +336,17 @@ public Builder application(ScheduledInterviewRequestApplication application) { return this; } + public Builder application(Nullable application) { + if (application.isNull()) { + this.application = null; + } else if (application.isEmpty()) { + this.application = Optional.empty(); + } else { + this.application = Optional.of(application.get()); + } + return this; + } + /** *

        The stage of the interview.

        */ @@ -266,6 +361,17 @@ public Builder jobInterviewStage(ScheduledInterviewRequestJobInterviewStage jobI return this; } + public Builder jobInterviewStage(Nullable jobInterviewStage) { + if (jobInterviewStage.isNull()) { + this.jobInterviewStage = null; + } else if (jobInterviewStage.isEmpty()) { + this.jobInterviewStage = Optional.empty(); + } else { + this.jobInterviewStage = Optional.of(jobInterviewStage.get()); + } + return this; + } + /** *

        The user organizing the interview.

        */ @@ -280,6 +386,17 @@ public Builder organizer(ScheduledInterviewRequestOrganizer organizer) { return this; } + public Builder organizer(Nullable organizer) { + if (organizer.isNull()) { + this.organizer = null; + } else if (organizer.isEmpty()) { + this.organizer = Optional.empty(); + } else { + this.organizer = Optional.of(organizer.get()); + } + return this; + } + /** *

        Array of RemoteUser IDs.

        */ @@ -308,6 +425,17 @@ public Builder location(String location) { return this; } + public Builder location(Nullable location) { + if (location.isNull()) { + this.location = null; + } else if (location.isEmpty()) { + this.location = Optional.empty(); + } else { + this.location = Optional.of(location.get()); + } + return this; + } + /** *

        When the interview was started.

        */ @@ -322,6 +450,17 @@ public Builder startAt(OffsetDateTime startAt) { return this; } + public Builder startAt(Nullable startAt) { + if (startAt.isNull()) { + this.startAt = null; + } else if (startAt.isEmpty()) { + this.startAt = Optional.empty(); + } else { + this.startAt = Optional.of(startAt.get()); + } + return this; + } + /** *

        When the interview was ended.

        */ @@ -336,6 +475,17 @@ public Builder endAt(OffsetDateTime endAt) { return this; } + public Builder endAt(Nullable endAt) { + if (endAt.isNull()) { + this.endAt = null; + } else if (endAt.isEmpty()) { + this.endAt = Optional.empty(); + } else { + this.endAt = Optional.of(endAt.get()); + } + return this; + } + /** *

        The interview's status.

        *
          @@ -355,6 +505,17 @@ public Builder status(ScheduledInterviewRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -366,6 +527,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -377,6 +549,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ScheduledInterviewRequest build() { return new ScheduledInterviewRequest( application, diff --git a/src/main/java/com/merge/api/ats/types/Scorecard.java b/src/main/java/com/merge/api/ats/types/Scorecard.java index ebfae7a33..857d15b5e 100644 --- a/src/main/java/com/merge/api/ats/types/Scorecard.java +++ b/src/main/java/com/merge/api/ats/types/Scorecard.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,40 +120,55 @@ public Optional getModifiedAt() { /** * @return The application being scored. */ - @JsonProperty("application") + @JsonIgnore public Optional getApplication() { + if (application == null) { + return Optional.empty(); + } return application; } /** * @return The interview being scored. */ - @JsonProperty("interview") + @JsonIgnore public Optional getInterview() { + if (interview == null) { + return Optional.empty(); + } return interview; } /** * @return The interviewer doing the scoring. */ - @JsonProperty("interviewer") + @JsonIgnore public Optional getInterviewer() { + if (interviewer == null) { + return Optional.empty(); + } return interviewer; } /** * @return When the third party's scorecard was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the scorecard was submitted. */ - @JsonProperty("submitted_at") + @JsonIgnore public Optional getSubmittedAt() { + if (submittedAt == null) { + return Optional.empty(); + } return submittedAt; } @@ -161,8 +182,11 @@ public Optional getSubmittedAt() { *
        • NO_DECISION - NO_DECISION
        • *
        */ - @JsonProperty("overall_recommendation") + @JsonIgnore public Optional getOverallRecommendation() { + if (overallRecommendation == null) { + return Optional.empty(); + } return overallRecommendation; } @@ -174,13 +198,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("application") + private Optional _getApplication() { + return application; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("interview") + private Optional _getInterview() { + return interview; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("interviewer") + private Optional _getInterviewer() { + return interviewer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("submitted_at") + private Optional _getSubmittedAt() { + return submittedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("overall_recommendation") + private Optional _getOverallRecommendation() { + return overallRecommendation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -313,6 +397,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -355,6 +450,17 @@ public Builder application(ScorecardApplication application) { return this; } + public Builder application(Nullable application) { + if (application.isNull()) { + this.application = null; + } else if (application.isEmpty()) { + this.application = Optional.empty(); + } else { + this.application = Optional.of(application.get()); + } + return this; + } + /** *

        The interview being scored.

        */ @@ -369,6 +475,17 @@ public Builder interview(ScorecardInterview interview) { return this; } + public Builder interview(Nullable interview) { + if (interview.isNull()) { + this.interview = null; + } else if (interview.isEmpty()) { + this.interview = Optional.empty(); + } else { + this.interview = Optional.of(interview.get()); + } + return this; + } + /** *

        The interviewer doing the scoring.

        */ @@ -383,6 +500,17 @@ public Builder interviewer(ScorecardInterviewer interviewer) { return this; } + public Builder interviewer(Nullable interviewer) { + if (interviewer.isNull()) { + this.interviewer = null; + } else if (interviewer.isEmpty()) { + this.interviewer = Optional.empty(); + } else { + this.interviewer = Optional.of(interviewer.get()); + } + return this; + } + /** *

        When the third party's scorecard was created.

        */ @@ -397,6 +525,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the scorecard was submitted.

        */ @@ -411,6 +550,17 @@ public Builder submittedAt(OffsetDateTime submittedAt) { return this; } + public Builder submittedAt(Nullable submittedAt) { + if (submittedAt.isNull()) { + this.submittedAt = null; + } else if (submittedAt.isEmpty()) { + this.submittedAt = Optional.empty(); + } else { + this.submittedAt = Optional.of(submittedAt.get()); + } + return this; + } + /** *

        The inteviewer's recommendation.

        *
          @@ -432,6 +582,17 @@ public Builder overallRecommendation(ScorecardOverallRecommendation overallRecom return this; } + public Builder overallRecommendation(Nullable overallRecommendation) { + if (overallRecommendation.isNull()) { + this.overallRecommendation = null; + } else if (overallRecommendation.isEmpty()) { + this.overallRecommendation = Optional.empty(); + } else { + this.overallRecommendation = Optional.of(overallRecommendation.get()); + } + 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.

          */ @@ -457,6 +618,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -468,6 +640,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Scorecard build() { return new Scorecard( id, 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..babd42b9a 100644 --- a/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -49,11 +52,11 @@ public final class ScorecardsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -71,9 +74,9 @@ private ScorecardsListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.applicationId = applicationId; @@ -202,15 +205,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -218,10 +224,16 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -310,11 +322,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -532,12 +544,12 @@ public Builder pageSize(Integer pageSize) { *

          Deprecated. Use show_enum_origins.

          */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(ScorecardsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -556,16 +568,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ScorecardsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestRemoteFields.java new file mode 100644 index 000000000..341e41d42 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 ScorecardsListRequestRemoteFields { + public static final ScorecardsListRequestRemoteFields OVERALL_RECOMMENDATION = + new ScorecardsListRequestRemoteFields(Value.OVERALL_RECOMMENDATION, "overall_recommendation"); + + private final Value value; + + private final String string; + + ScorecardsListRequestRemoteFields(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 ScorecardsListRequestRemoteFields + && this.string.equals(((ScorecardsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OVERALL_RECOMMENDATION: + return visitor.visitOverallRecommendation(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ScorecardsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "overall_recommendation": + return OVERALL_RECOMMENDATION; + default: + return new ScorecardsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + OVERALL_RECOMMENDATION, + + UNKNOWN + } + + public interface Visitor { + T visitOverallRecommendation(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..caa8f64f8 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ScorecardsListRequestShowEnumOrigins { + public static final ScorecardsListRequestShowEnumOrigins OVERALL_RECOMMENDATION = + new ScorecardsListRequestShowEnumOrigins(Value.OVERALL_RECOMMENDATION, "overall_recommendation"); + + private final Value value; + + private final String string; + + ScorecardsListRequestShowEnumOrigins(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 ScorecardsListRequestShowEnumOrigins + && this.string.equals(((ScorecardsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OVERALL_RECOMMENDATION: + return visitor.visitOverallRecommendation(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ScorecardsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "overall_recommendation": + return OVERALL_RECOMMENDATION; + default: + return new ScorecardsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + OVERALL_RECOMMENDATION, + + UNKNOWN + } + + public interface Visitor { + T visitOverallRecommendation(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java index 9bd2c1fac..d616f8934 100644 --- a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequest.java @@ -28,9 +28,9 @@ public final class ScorecardsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -38,8 +38,8 @@ private ScorecardsRetrieveRequest( Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -131,9 +131,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

          Deprecated. Use show_enum_origins.

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

          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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(ScorecardsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..af0122dc6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 ScorecardsRetrieveRequestRemoteFields { + public static final ScorecardsRetrieveRequestRemoteFields OVERALL_RECOMMENDATION = + new ScorecardsRetrieveRequestRemoteFields(Value.OVERALL_RECOMMENDATION, "overall_recommendation"); + + private final Value value; + + private final String string; + + ScorecardsRetrieveRequestRemoteFields(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 ScorecardsRetrieveRequestRemoteFields + && this.string.equals(((ScorecardsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OVERALL_RECOMMENDATION: + return visitor.visitOverallRecommendation(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ScorecardsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "overall_recommendation": + return OVERALL_RECOMMENDATION; + default: + return new ScorecardsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + OVERALL_RECOMMENDATION, + + UNKNOWN + } + + public interface Visitor { + T visitOverallRecommendation(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..fe098e60c --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/ScorecardsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 ScorecardsRetrieveRequestShowEnumOrigins { + public static final ScorecardsRetrieveRequestShowEnumOrigins OVERALL_RECOMMENDATION = + new ScorecardsRetrieveRequestShowEnumOrigins(Value.OVERALL_RECOMMENDATION, "overall_recommendation"); + + private final Value value; + + private final String string; + + ScorecardsRetrieveRequestShowEnumOrigins(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 ScorecardsRetrieveRequestShowEnumOrigins + && this.string.equals(((ScorecardsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case OVERALL_RECOMMENDATION: + return visitor.visitOverallRecommendation(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ScorecardsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "overall_recommendation": + return OVERALL_RECOMMENDATION; + default: + return new ScorecardsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + OVERALL_RECOMMENDATION, + + UNKNOWN + } + + public interface Visitor { + T visitOverallRecommendation(); + + T visitUnknown(String unknownType); + } +} 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..e9d4fcaae 100644 --- a/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestion.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,24 +112,33 @@ public Optional getModifiedAt() { /** * @return The job associated with the screening question. */ - @JsonProperty("job") + @JsonIgnore public Optional getJob() { + if (job == null) { + return Optional.empty(); + } return job; } /** * @return The description of the screening question */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The title of the screening question */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } @@ -140,16 +155,22 @@ public Optional getTitle() { *
        • BOOLEAN - BOOLEAN
        • *
        */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return Whether or not the screening question is required. */ - @JsonProperty("required") + @JsonIgnore public Optional getRequired() { + if (required == null) { + return Optional.empty(); + } return required; } @@ -166,6 +187,42 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job") + private Optional _getJob() { + return job; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("required") + private Optional _getRequired() { + return required; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -285,6 +342,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -327,6 +395,17 @@ public Builder job(ScreeningQuestionJob job) { return this; } + public Builder job(Nullable job) { + if (job.isNull()) { + this.job = null; + } else if (job.isEmpty()) { + this.job = Optional.empty(); + } else { + this.job = Optional.of(job.get()); + } + return this; + } + /** *

        The description of the screening question

        */ @@ -341,6 +420,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The title of the screening question

        */ @@ -355,6 +445,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

        The data type for the screening question.

        *
          @@ -379,6 +480,17 @@ public Builder type(ScreeningQuestionType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

          Whether or not the screening question is required.

          */ @@ -393,6 +505,17 @@ public Builder required(Boolean required) { return this; } + public Builder required(Nullable required) { + if (required.isNull()) { + this.required = null; + } else if (required.isEmpty()) { + this.required = Optional.empty(); + } else { + this.required = Optional.of(required.get()); + } + return this; + } + @JsonSetter(value = "options", nulls = Nulls.SKIP) public Builder options(Optional> options) { this.options = options; diff --git a/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java index 084e4f839..15dfcd217 100644 --- a/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswer.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -64,8 +67,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -88,16 +94,22 @@ public Optional getModifiedAt() { /** * @return 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. */ - @JsonProperty("question") + @JsonIgnore public Optional getQuestion() { + if (question == null) { + return Optional.empty(); + } return question; } /** * @return The candidate’s response to the screening question. */ - @JsonProperty("answer") + @JsonIgnore public Optional getAnswer() { + if (answer == null) { + return Optional.empty(); + } return answer; } @@ -109,6 +121,24 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("question") + private Optional _getQuestion() { + return question; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("answer") + private Optional _getAnswer() { + return answer; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -208,6 +238,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -250,6 +291,17 @@ public Builder question(ScreeningQuestionAnswerQuestion question) { return this; } + public Builder question(Nullable question) { + if (question.isNull()) { + this.question = null; + } else if (question.isEmpty()) { + this.question = Optional.empty(); + } else { + this.question = Optional.of(question.get()); + } + return this; + } + /** *

          The candidate’s response to the screening question.

          */ @@ -264,6 +316,17 @@ public Builder answer(String answer) { return this; } + public Builder answer(Nullable answer) { + if (answer.isNull()) { + this.answer = null; + } else if (answer.isEmpty()) { + this.answer = Optional.empty(); + } else { + this.answer = Optional.of(answer.get()); + } + 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.

          */ diff --git a/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerRequest.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerRequest.java index 0cccf180d..aaceb787f 100644 --- a/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerRequest.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionAnswerRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -51,34 +54,79 @@ private ScreeningQuestionAnswerRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return 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. */ - @JsonProperty("question") + @JsonIgnore public Optional getQuestion() { + if (question == null) { + return Optional.empty(); + } return question; } /** * @return The candidate’s response to the screening question. */ - @JsonProperty("answer") + @JsonIgnore public Optional getAnswer() { + if (answer == null) { + return Optional.empty(); + } return answer; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("question") + private Optional _getQuestion() { + return question; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("answer") + private Optional _getAnswer() { + return answer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -156,6 +204,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          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.

          */ @@ -170,6 +229,17 @@ public Builder question(ScreeningQuestionAnswerRequestQuestion question) { return this; } + public Builder question(Nullable question) { + if (question.isNull()) { + this.question = null; + } else if (question.isEmpty()) { + this.question = Optional.empty(); + } else { + this.question = Optional.of(question.get()); + } + return this; + } + /** *

          The candidate’s response to the screening question.

          */ @@ -184,6 +254,17 @@ public Builder answer(String answer) { return this; } + public Builder answer(Nullable answer) { + if (answer.isNull()) { + this.answer = null; + } else if (answer.isEmpty()) { + this.answer = Optional.empty(); + } else { + this.answer = Optional.of(answer.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -195,6 +276,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -206,6 +298,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ScreeningQuestionAnswerRequest build() { return new ScreeningQuestionAnswerRequest( remoteId, question, answer, integrationParams, linkedAccountParams, additionalProperties); diff --git a/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java index bbea353ae..9ef7fe07b 100644 --- a/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java +++ b/src/main/java/com/merge/api/ats/types/ScreeningQuestionOption.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -60,8 +63,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -84,8 +90,11 @@ public Optional getModifiedAt() { /** * @return Available response options */ - @JsonProperty("label") + @JsonIgnore public Optional getLabel() { + if (label == null) { + return Optional.empty(); + } return label; } @@ -97,6 +106,18 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("label") + private Optional _getLabel() { + return label; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -185,6 +206,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -227,6 +259,17 @@ public Builder label(String label) { return this; } + public Builder label(Nullable label) { + if (label.isNull()) { + this.label = null; + } else if (label.isEmpty()) { + this.label = Optional.empty(); + } else { + this.label = Optional.of(label.get()); + } + 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.

          */ diff --git a/src/main/java/com/merge/api/ats/types/Tag.java b/src/main/java/com/merge/api/ats/types/Tag.java index 84ec83f79..a0d527a4c 100644 --- a/src/main/java/com/merge/api/ats/types/Tag.java +++ b/src/main/java/com/merge/api/ats/types/Tag.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -61,8 +64,11 @@ private Tag( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -85,8 +91,11 @@ public Optional getModifiedAt() { /** * @return The tag's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -98,13 +107,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional>>> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional>>> _getRemoteData() { return remoteData; } @@ -196,6 +235,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -238,6 +288,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + 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.

          */ @@ -263,6 +324,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional>>> remoteData) { this.remoteData = remoteData; @@ -274,6 +346,17 @@ public Builder remoteData(List>> remoteData) { return this; } + public Builder remoteData(Nullable>>> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Tag build() { return new Tag( remoteId, 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..80770f65e 100644 --- a/src/main/java/com/merge/api/ats/types/TagsListRequest.java +++ b/src/main/java/com/merge/api/ats/types/TagsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TagsListRequest build() { return new TagsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java b/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java index 2a3a116ee..340e3d2cf 100644 --- a/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java +++ b/src/main/java/com/merge/api/ats/types/UpdateApplicationStageRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -62,8 +65,11 @@ public Optional getRunAsync() { /** * @return The interview stage to move the application to. */ - @JsonProperty("job_interview_stage") + @JsonIgnore public Optional getJobInterviewStage() { + if (jobInterviewStage == null) { + return Optional.empty(); + } return jobInterviewStage; } @@ -72,6 +78,12 @@ public Optional getRemoteUserId() { return remoteUserId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job_interview_stage") + private Optional _getJobInterviewStage() { + return jobInterviewStage; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -169,6 +181,17 @@ public Builder jobInterviewStage(String jobInterviewStage) { return this; } + public Builder jobInterviewStage(Nullable jobInterviewStage) { + if (jobInterviewStage.isNull()) { + this.jobInterviewStage = null; + } else if (jobInterviewStage.isEmpty()) { + this.jobInterviewStage = Optional.empty(); + } else { + this.jobInterviewStage = Optional.of(jobInterviewStage.get()); + } + return this; + } + @JsonSetter(value = "remote_user_id", nulls = Nulls.SKIP) public Builder remoteUserId(Optional remoteUserId) { this.remoteUserId = remoteUserId; diff --git a/src/main/java/com/merge/api/ats/types/Url.java b/src/main/java/com/merge/api/ats/types/Url.java index be4aff1d8..e85551dde 100644 --- a/src/main/java/com/merge/api/ats/types/Url.java +++ b/src/main/java/com/merge/api/ats/types/Url.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -67,8 +70,11 @@ public Optional getModifiedAt() { /** * @return The site's url. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -84,8 +90,11 @@ public Optional getValue() { *
        • JOB_POSTING - JOB_POSTING
        • *
        */ - @JsonProperty("url_type") + @JsonIgnore public Optional getUrlType() { + if (urlType == null) { + return Optional.empty(); + } return urlType; } @@ -97,6 +106,18 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_type") + private Optional _getUrlType() { + return urlType; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -198,6 +219,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

        The type of site.

        *
          @@ -221,6 +253,17 @@ public Builder urlType(UrlUrlType urlType) { return this; } + public Builder urlType(Nullable urlType) { + if (urlType.isNull()) { + this.urlType = null; + } else if (urlType.isEmpty()) { + this.urlType = Optional.empty(); + } else { + this.urlType = Optional.of(urlType.get()); + } + 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.

          */ diff --git a/src/main/java/com/merge/api/ats/types/UrlRequest.java b/src/main/java/com/merge/api/ats/types/UrlRequest.java index 213721eba..646d38b7d 100644 --- a/src/main/java/com/merge/api/ats/types/UrlRequest.java +++ b/src/main/java/com/merge/api/ats/types/UrlRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,8 +50,11 @@ private UrlRequest( /** * @return The site's url. */ - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } @@ -64,18 +70,51 @@ public Optional getValue() { *
        • JOB_POSTING - JOB_POSTING
        • *
        */ - @JsonProperty("url_type") + @JsonIgnore public Optional getUrlType() { + if (urlType == null) { + return Optional.empty(); + } return urlType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_type") + private Optional _getUrlType() { + return urlType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -148,6 +187,17 @@ public Builder value(String value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + /** *

        The type of site.

        *
          @@ -171,6 +221,17 @@ public Builder urlType(UrlRequestUrlType urlType) { return this; } + public Builder urlType(Nullable urlType) { + if (urlType.isNull()) { + this.urlType = null; + } else if (urlType.isEmpty()) { + this.urlType = Optional.empty(); + } else { + this.urlType = Optional.of(urlType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -182,6 +243,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -193,6 +265,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public UrlRequest build() { return new UrlRequest(value, urlType, integrationParams, linkedAccountParams, additionalProperties); } 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..f7850e413 100644 --- a/src/main/java/com/merge/api/ats/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/ats/types/UsersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -41,11 +44,11 @@ public final class UsersListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -60,9 +63,9 @@ private UsersListRequest( Optional modifiedAfter, Optional modifiedBefore, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.createdAfter = createdAfter; this.createdBefore = createdBefore; @@ -107,8 +110,11 @@ public Optional getCursor() { /** * @return If provided, will only return remote users with the given email address */ - @JsonProperty("email") + @JsonIgnore public Optional getEmail() { + if (email == null) { + return Optional.empty(); + } return email; } @@ -164,15 +170,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -180,10 +189,22 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + private Optional _getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -260,11 +281,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -344,6 +365,17 @@ public Builder email(String email) { return this; } + public Builder email(Nullable email) { + if (email.isNull()) { + this.email = null; + } else if (email.isEmpty()) { + this.email = Optional.empty(); + } else { + this.email = Optional.of(email.get()); + } + 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.

          */ @@ -432,12 +464,12 @@ public Builder pageSize(Integer pageSize) { *

          Deprecated. Use show_enum_origins.

          */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(UsersListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -456,16 +488,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(UsersListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/UsersListRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/UsersListRequestRemoteFields.java new file mode 100644 index 000000000..3448ef1ba --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 UsersListRequestRemoteFields { + public static final UsersListRequestRemoteFields ACCESS_ROLE = + new UsersListRequestRemoteFields(Value.ACCESS_ROLE, "access_role"); + + private final Value value; + + private final String string; + + UsersListRequestRemoteFields(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 UsersListRequestRemoteFields + && this.string.equals(((UsersListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCESS_ROLE: + return visitor.visitAccessRole(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UsersListRequestRemoteFields valueOf(String value) { + switch (value) { + case "access_role": + return ACCESS_ROLE; + default: + return new UsersListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_ROLE, + + UNKNOWN + } + + public interface Visitor { + T visitAccessRole(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/UsersListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/UsersListRequestShowEnumOrigins.java new file mode 100644 index 000000000..0ed27f4e6 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 UsersListRequestShowEnumOrigins { + public static final UsersListRequestShowEnumOrigins ACCESS_ROLE = + new UsersListRequestShowEnumOrigins(Value.ACCESS_ROLE, "access_role"); + + private final Value value; + + private final String string; + + UsersListRequestShowEnumOrigins(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 UsersListRequestShowEnumOrigins + && this.string.equals(((UsersListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCESS_ROLE: + return visitor.visitAccessRole(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UsersListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "access_role": + return ACCESS_ROLE; + default: + return new UsersListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_ROLE, + + UNKNOWN + } + + public interface Visitor { + T visitAccessRole(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java index e0d0d02e0..0d6be6ecf 100644 --- a/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java +++ b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequest.java @@ -24,17 +24,17 @@ public final class UsersRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private UsersRetrieveRequest( Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -63,7 +63,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -71,7 +71,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -113,9 +113,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,12 +162,12 @@ public Builder includeShellData(Boolean includeShellData) { *

          Deprecated. Use show_enum_origins.

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

          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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(UsersRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..94b8fb659 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 UsersRetrieveRequestRemoteFields { + public static final UsersRetrieveRequestRemoteFields ACCESS_ROLE = + new UsersRetrieveRequestRemoteFields(Value.ACCESS_ROLE, "access_role"); + + private final Value value; + + private final String string; + + UsersRetrieveRequestRemoteFields(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 UsersRetrieveRequestRemoteFields + && this.string.equals(((UsersRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCESS_ROLE: + return visitor.visitAccessRole(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UsersRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "access_role": + return ACCESS_ROLE; + default: + return new UsersRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_ROLE, + + UNKNOWN + } + + public interface Visitor { + T visitAccessRole(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..e97d45b95 --- /dev/null +++ b/src/main/java/com/merge/api/ats/types/UsersRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 UsersRetrieveRequestShowEnumOrigins { + public static final UsersRetrieveRequestShowEnumOrigins ACCESS_ROLE = + new UsersRetrieveRequestShowEnumOrigins(Value.ACCESS_ROLE, "access_role"); + + private final Value value; + + private final String string; + + UsersRetrieveRequestShowEnumOrigins(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 UsersRetrieveRequestShowEnumOrigins + && this.string.equals(((UsersRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCESS_ROLE: + return visitor.visitAccessRole(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static UsersRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "access_role": + return ACCESS_ROLE; + default: + return new UsersRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCESS_ROLE, + + UNKNOWN + } + + public interface Visitor { + T visitAccessRole(); + + T visitUnknown(String unknownType); + } +} 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..7f3964b0a 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.0.2"); 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.0.2"); } }); 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..29eec13b4 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.AccountTokenRetrieveRequest; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/crm/AccountsClient.java b/src/main/java/com/merge/api/crm/AccountsClient.java index ab6fb96cb..c612c6c9e 100644 --- a/src/main/java/com/merge/api/crm/AccountsClient.java +++ b/src/main/java/com/merge/api/crm/AccountsClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Account; import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsMetaPatchRetrieveRequest; import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; import com.merge.api.crm.types.AccountsRetrieveRequest; import com.merge.api.crm.types.CrmAccountEndpointRequest; @@ -114,8 +115,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for CRMAccount PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, AccountsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, AccountsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/crm/AssociationTypesClient.java b/src/main/java/com/merge/api/crm/AssociationTypesClient.java index 99855ca2f..bb6e3d996 100644 --- a/src/main/java/com/merge/api/crm/AssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/AssociationTypesClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; import com.merge.api.crm.types.CrmAssociationTypeResponse; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -126,9 +127,21 @@ public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve(String c * Returns metadata for CRMAssociationType POSTs. */ public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request) { return this.rawClient - .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, requestOptions) + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request) + .body(); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MetaResponse customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request, 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..d31465cad 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.AccountTokenRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/crm/AsyncAccountsClient.java b/src/main/java/com/merge/api/crm/AsyncAccountsClient.java index e5d64a216..174a6d9f4 100644 --- a/src/main/java/com/merge/api/crm/AsyncAccountsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncAccountsClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Account; import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsMetaPatchRetrieveRequest; import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; import com.merge.api.crm.types.AccountsRetrieveRequest; import com.merge.api.crm.types.CrmAccountEndpointRequest; @@ -118,8 +119,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for CRMAccount PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, AccountsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, AccountsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java b/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java index ba12a82e0..c6dc99dfb 100644 --- a/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncAssociationTypesClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; import com.merge.api.crm.types.CrmAssociationTypeResponse; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; import com.merge.api.crm.types.MetaResponse; import java.util.concurrent.CompletableFuture; @@ -130,9 +131,21 @@ public CompletableFuture customObjectClassesAssociationTypesMetaPo * Returns metadata for CRMAssociationType POSTs. */ public CompletableFuture customObjectClassesAssociationTypesMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request) { return this.rawClient - .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, requestOptions) + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java index 256a0598a..7c548cc0e 100644 --- a/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/AsyncAsyncPassthroughClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveRequest; import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; import com.merge.api.crm.types.DataPassthroughRequest; import java.util.concurrent.CompletableFuture; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/crm/AsyncContactsClient.java b/src/main/java/com/merge/api/crm/AsyncContactsClient.java index 78874c8df..c97f7193b 100644 --- a/src/main/java/com/merge/api/crm/AsyncContactsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncContactsClient.java @@ -7,12 +7,13 @@ import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsIgnoreCreateRequest; import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsMetaPatchRetrieveRequest; import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.crm.types.ContactsRetrieveRequest; import com.merge.api.crm.types.CrmContactEndpointRequest; import com.merge.api.crm.types.CrmContactResponse; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; import com.merge.api.crm.types.RemoteFieldClass; @@ -112,7 +113,7 @@ public CompletableFuture partialUpdate( /** * 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. */ - public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public CompletableFuture ignoreCreate(String modelId, ContactsIgnoreCreateRequest request) { return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); } @@ -120,7 +121,7 @@ public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelReq * 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. */ public CompletableFuture ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, ContactsIgnoreCreateRequest request, RequestOptions requestOptions) { return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); } @@ -134,8 +135,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for CRMContact PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, ContactsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, ContactsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java b/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java index a8548dcfa..bcc811938 100644 --- a/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncCustomObjectsClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.CrmCustomObjectResponse; import com.merge.api.crm.types.CustomObject; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -132,9 +133,21 @@ public CompletableFuture customObjectClassesCustomObjectsMetaPostR * Returns metadata for CRMCustomObject POSTs. */ public CompletableFuture customObjectClassesCustomObjectsMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request) { return this.rawClient - .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, requestOptions) + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request) + .thenApply(response -> response.body()); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java b/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java index 0f07c3c92..6cd414319 100644 --- a/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncEngagementsClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.EngagementEndpointRequest; import com.merge.api.crm.types.EngagementResponse; import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsMetaPatchRetrieveRequest; import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; import com.merge.api.crm.types.EngagementsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -118,8 +119,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Engagement PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, EngagementsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, EngagementsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java index 6d404b531..5ddcc189c 100644 --- a/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/AsyncFieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.crm.types.ExternalTargetFieldApiResponse; import com.merge.api.crm.types.FieldMappingApiInstanceResponse; import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsDestroyRequest; import com.merge.api.crm.types.FieldMappingsRetrieveRequest; import com.merge.api.crm.types.PatchedEditFieldMappingRequest; import com.merge.api.crm.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/crm/AsyncIssuesClient.java b/src/main/java/com/merge/api/crm/AsyncIssuesClient.java index 0c206f458..00530fff4 100644 --- a/src/main/java/com/merge/api/crm/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncIssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Issue; import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.IssuesRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncIssuesClient { @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java b/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java index 2b3c9a895..091444483 100644 --- a/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncOpportunitiesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesMetaPatchRetrieveRequest; import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; import com.merge.api.crm.types.OpportunitiesRetrieveRequest; import com.merge.api.crm.types.Opportunity; @@ -118,8 +119,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Opportunity PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, OpportunitiesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, OpportunitiesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, 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..8c871f6d6 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.AccountTokenRetrieveRequest; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..9eed75fb1 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAccountsClient.java @@ -14,6 +14,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Account; import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsMetaPatchRetrieveRequest; import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; import com.merge.api.crm.types.AccountsRetrieveRequest; import com.merge.api.crm.types.CrmAccountEndpointRequest; @@ -25,10 +26,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; import okhttp3.Call; @@ -151,10 +149,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -162,7 +161,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -433,25 +419,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for CRMAccount PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, AccountsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, AccountsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for CRMAccount PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, AccountsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/accounts/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -461,18 +455,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 +508,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,10 +615,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsRemoteFieldClassesListRequest nextRequest = AccountsRemoteFieldClassesListRequest.builder() .from(request) @@ -640,7 +629,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -652,12 +641,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..aa2fe4caf 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationTypesClient.java @@ -16,15 +16,13 @@ import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; import com.merge.api.crm.types.CrmAssociationTypeResponse; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; import com.merge.api.crm.types.MetaResponse; 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; import okhttp3.Call; @@ -142,10 +140,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAssociationTypeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesAssociationTypesListRequest nextRequest = CustomObjectClassesAssociationTypesListRequest.builder() .from(request) @@ -155,7 +154,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return customObjectClassesAssociationTypesList( customObjectClassId, nextRequest, requestOptions) @@ -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)); @@ -364,26 +354,40 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> customObjectClassesAssociationTypesMetaPostRetrieve( String customObjectClassId) { - return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, null); + return customObjectClassesAssociationTypesMetaPostRetrieve( + customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.builder() + .build()); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public CompletableFuture> customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request) { + return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request, null); } /** * Returns metadata for CRMAssociationType POSTs. */ public CompletableFuture> customObjectClassesAssociationTypesMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request, + RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .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() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -393,18 +397,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..9d8158939 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAssociationsClient.java @@ -18,7 +18,6 @@ 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; @@ -150,10 +149,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedAssociationList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = CustomObjectClassesCustomObjectsAssociationsListRequest.builder() .from(request) @@ -162,7 +162,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return customObjectClassesCustomObjectsAssociationsList( customObjectClassId, @@ -178,12 +178,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 +272,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..6b5a49f41 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveRequest; import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; import com.merge.api.crm.types.DataPassthroughRequest; import java.io.IOException; @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..d577a08ba 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..806d943ce 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawContactsClient.java @@ -14,12 +14,13 @@ import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsIgnoreCreateRequest; import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsMetaPatchRetrieveRequest; import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.crm.types.ContactsRetrieveRequest; import com.merge.api.crm.types.CrmContactEndpointRequest; import com.merge.api.crm.types.CrmContactResponse; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.PaginatedContactList; import com.merge.api.crm.types.PaginatedRemoteFieldClassList; @@ -27,10 +28,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; import okhttp3.Call; @@ -157,10 +155,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) @@ -168,7 +167,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -439,7 +425,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request) { + String modelId, ContactsIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -447,7 +433,7 @@ public CompletableFuture> ignoreCreate( * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, ContactsIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/contacts/ignore") @@ -456,7 +442,7 @@ public CompletableFuture> ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize 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)); @@ -503,25 +487,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for CRMContact PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, ContactsMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for CRMContact PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, ContactsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, ContactsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/contacts/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -531,18 +523,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 +576,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,10 +683,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) @@ -710,7 +697,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -722,12 +709,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..89ebf9e40 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectClassesClient.java @@ -18,7 +18,6 @@ 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; @@ -127,10 +126,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedCustomObjectClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -139,7 +139,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -151,12 +151,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 +222,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..2e64edb83 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawCustomObjectsClient.java @@ -16,6 +16,7 @@ import com.merge.api.crm.types.CrmCustomObjectResponse; import com.merge.api.crm.types.CustomObject; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -24,10 +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; import okhttp3.Call; @@ -148,10 +146,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedCustomObjectList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsListRequest nextRequest = CustomObjectClassesCustomObjectsListRequest.builder() .from(request) @@ -160,7 +159,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return customObjectClassesCustomObjectsList( customObjectClassId, nextRequest, requestOptions) @@ -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)); @@ -368,26 +356,40 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> customObjectClassesCustomObjectsMetaPostRetrieve( String customObjectClassId) { - return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, null); + return customObjectClassesCustomObjectsMetaPostRetrieve( + customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.builder() + .build()); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public CompletableFuture> customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request) { + return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request, null); } /** * Returns metadata for CRMCustomObject POSTs. */ public CompletableFuture> customObjectClassesCustomObjectsMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request, + RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .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() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -397,18 +399,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,10 +511,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() .from(request) @@ -525,7 +525,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return customObjectClassesCustomObjectsRemoteFieldClassesList( nextRequest, requestOptions) @@ -538,12 +538,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..f20016dda 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementTypesClient.java @@ -21,7 +21,6 @@ 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; @@ -132,10 +131,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedEngagementTypeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() .from(request) .cursor(startingAfter) @@ -144,7 +144,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -156,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)); @@ -233,18 +230,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,10 +338,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementTypesRemoteFieldClassesListRequest nextRequest = EngagementTypesRemoteFieldClassesListRequest.builder() .from(request) @@ -356,7 +352,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -368,12 +364,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..4ea99fade 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawEngagementsClient.java @@ -16,6 +16,7 @@ import com.merge.api.crm.types.EngagementEndpointRequest; import com.merge.api.crm.types.EngagementResponse; import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsMetaPatchRetrieveRequest; import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; import com.merge.api.crm.types.EngagementsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -25,10 +26,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; import okhttp3.Call; @@ -152,10 +150,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedEngagementList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementsListRequest nextRequest = EngagementsListRequest.builder() .from(request) .cursor(startingAfter) @@ -163,7 +162,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -435,25 +420,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Engagement PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, EngagementsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, EngagementsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Engagement PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, EngagementsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/engagements/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -463,18 +457,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 +510,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,10 +617,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementsRemoteFieldClassesListRequest nextRequest = EngagementsRemoteFieldClassesListRequest.builder() .from(request) @@ -642,7 +631,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -654,12 +643,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..949623400 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.crm.types.ExternalTargetFieldApiResponse; import com.merge.api.crm.types.FieldMappingApiInstanceResponse; import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsDestroyRequest; import com.merge.api.crm.types.FieldMappingsRetrieveRequest; import com.merge.api.crm.types.PatchedEditFieldMappingRequest; 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 +86,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 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -304,19 +299,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 +373,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 +428,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..e42785dda 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Issue; import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.IssuesRetrieveRequest; import com.merge.api.crm.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; @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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..a30b69228 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLeadsClient.java @@ -24,10 +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; import okhttp3.Call; @@ -168,17 +165,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLeadList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LeadsListRequest nextRequest = LeadsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -190,12 +188,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 +228,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 +251,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 +334,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 +387,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,10 +494,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -521,7 +507,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -533,12 +519,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..45d73540f 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkTokenClient.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(), 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..99498a32a 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -138,10 +137,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); diff --git a/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java index d17fdcf02..ea658f0c2 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawNotesClient.java @@ -24,10 +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; import okhttp3.Call; @@ -158,17 +155,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedNoteList.class); + String startingAfter = parsedResponse.getNext().orElse(null); NotesListRequest nextRequest = NotesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -180,12 +178,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 +218,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 +241,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 +324,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 +377,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,10 +484,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -511,7 +497,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -523,12 +509,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..b623c0bb4 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawOpportunitiesClient.java @@ -14,6 +14,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesMetaPatchRetrieveRequest; import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; import com.merge.api.crm.types.OpportunitiesRetrieveRequest; import com.merge.api.crm.types.Opportunity; @@ -25,10 +26,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; import okhttp3.Call; @@ -175,10 +173,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedOpportunityList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOpportunityList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() .from(request) .cursor(startingAfter) @@ -186,7 +185,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -467,25 +452,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Opportunity PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, OpportunitiesMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, OpportunitiesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Opportunity PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, OpportunitiesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/opportunities/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -495,18 +489,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 +542,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,10 +649,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OpportunitiesRemoteFieldClassesListRequest nextRequest = OpportunitiesRemoteFieldClassesListRequest.builder() .from(request) @@ -674,7 +663,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -686,12 +675,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..9b6e6cbdb 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawStagesClient.java @@ -21,7 +21,6 @@ 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; @@ -131,17 +130,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedStageList.class); + String startingAfter = parsedResponse.getNext().orElse(null); StagesListRequest nextRequest = StagesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -153,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)); @@ -229,17 +226,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,10 +333,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -350,7 +346,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -362,12 +358,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..113a310f9 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawSyncStatusClient.java @@ -76,19 +76,16 @@ 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()) { future.complete(new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue( - responseBody.string(), PaginatedSyncStatusList.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..78edea20e 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawTasksClient.java @@ -21,14 +21,12 @@ import com.merge.api.crm.types.TaskEndpointRequest; import com.merge.api.crm.types.TaskResponse; import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksMetaPatchRetrieveRequest; import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; 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; import okhttp3.Call; @@ -143,17 +141,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaskList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TasksListRequest nextRequest = TasksListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -424,25 +408,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Task PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, TasksMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, TasksMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Task PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, TasksMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/tasks/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -452,18 +444,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 +497,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,10 +604,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -630,7 +617,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -642,12 +629,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..506566508 100644 --- a/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/crm/AsyncRawUsersClient.java @@ -13,18 +13,17 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.PaginatedRemoteFieldClassList; import com.merge.api.crm.types.PaginatedUserList; import com.merge.api.crm.types.RemoteFieldClass; import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersIgnoreCreateRequest; import com.merge.api.crm.types.UsersListRequest; import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; import com.merge.api.crm.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; @@ -139,17 +138,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -161,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)); @@ -237,17 +234,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)); @@ -266,7 +261,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request) { + String modelId, UsersIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -274,7 +269,7 @@ public CompletableFuture> ignoreCreate( * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, UsersIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/users/ignore") @@ -283,7 +278,7 @@ public CompletableFuture> ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize request", e); } @@ -307,11 +302,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,10 +403,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -422,7 +416,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -434,12 +428,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/AsyncTasksClient.java b/src/main/java/com/merge/api/crm/AsyncTasksClient.java index 2b096606f..6c0d7dc4a 100644 --- a/src/main/java/com/merge/api/crm/AsyncTasksClient.java +++ b/src/main/java/com/merge/api/crm/AsyncTasksClient.java @@ -13,6 +13,7 @@ import com.merge.api.crm.types.TaskEndpointRequest; import com.merge.api.crm.types.TaskResponse; import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksMetaPatchRetrieveRequest; import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; import com.merge.api.crm.types.TasksRetrieveRequest; import java.util.concurrent.CompletableFuture; @@ -115,8 +116,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Task PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, TasksMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Task PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, TasksMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/crm/AsyncUsersClient.java b/src/main/java/com/merge/api/crm/AsyncUsersClient.java index 87c1983e4..f6e00ba18 100644 --- a/src/main/java/com/merge/api/crm/AsyncUsersClient.java +++ b/src/main/java/com/merge/api/crm/AsyncUsersClient.java @@ -6,9 +6,9 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.RemoteFieldClass; import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersIgnoreCreateRequest; import com.merge.api.crm.types.UsersListRequest; import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; import com.merge.api.crm.types.UsersRetrieveRequest; @@ -76,7 +76,7 @@ public CompletableFuture retrieve(String id, UsersRetrieveRequest request, /** * 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. */ - public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public CompletableFuture ignoreCreate(String modelId, UsersIgnoreCreateRequest request) { return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); } @@ -84,7 +84,7 @@ public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelReq * 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. */ public CompletableFuture ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, UsersIgnoreCreateRequest request, RequestOptions requestOptions) { return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/crm/ContactsClient.java b/src/main/java/com/merge/api/crm/ContactsClient.java index 531d5adb6..d92b4b864 100644 --- a/src/main/java/com/merge/api/crm/ContactsClient.java +++ b/src/main/java/com/merge/api/crm/ContactsClient.java @@ -7,12 +7,13 @@ import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsIgnoreCreateRequest; import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsMetaPatchRetrieveRequest; import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.crm.types.ContactsRetrieveRequest; import com.merge.api.crm.types.CrmContactEndpointRequest; import com.merge.api.crm.types.CrmContactResponse; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.PatchedCrmContactEndpointRequest; import com.merge.api.crm.types.RemoteFieldClass; @@ -108,14 +109,14 @@ public CrmContactResponse partialUpdate( /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public void ignoreCreate(String modelId, ContactsIgnoreCreateRequest request) { this.rawClient.ignoreCreate(modelId, request).body(); } /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + public void ignoreCreate(String modelId, ContactsIgnoreCreateRequest request, RequestOptions requestOptions) { this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); } @@ -129,8 +130,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for CRMContact PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, ContactsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, ContactsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/crm/CustomObjectsClient.java b/src/main/java/com/merge/api/crm/CustomObjectsClient.java index 25974887f..fb733f8f2 100644 --- a/src/main/java/com/merge/api/crm/CustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/CustomObjectsClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.CrmCustomObjectResponse; import com.merge.api.crm.types.CustomObject; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -128,9 +129,21 @@ public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve(String cust * Returns metadata for CRMCustomObject POSTs. */ public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request) { return this.rawClient - .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, requestOptions) + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request) + .body(); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MetaResponse customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request, + RequestOptions requestOptions) { + return this.rawClient + .customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/crm/EngagementsClient.java b/src/main/java/com/merge/api/crm/EngagementsClient.java index 1fb3b7472..14c072a86 100644 --- a/src/main/java/com/merge/api/crm/EngagementsClient.java +++ b/src/main/java/com/merge/api/crm/EngagementsClient.java @@ -10,6 +10,7 @@ import com.merge.api.crm.types.EngagementEndpointRequest; import com.merge.api.crm.types.EngagementResponse; import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsMetaPatchRetrieveRequest; import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; import com.merge.api.crm.types.EngagementsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -114,8 +115,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Engagement PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, EngagementsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, EngagementsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/crm/FieldMappingClient.java b/src/main/java/com/merge/api/crm/FieldMappingClient.java index f03b639db..b36044f85 100644 --- a/src/main/java/com/merge/api/crm/FieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/FieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.crm.types.ExternalTargetFieldApiResponse; import com.merge.api.crm.types.FieldMappingApiInstanceResponse; import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsDestroyRequest; import com.merge.api.crm.types.FieldMappingsRetrieveRequest; import com.merge.api.crm.types.PatchedEditFieldMappingRequest; import com.merge.api.crm.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/crm/IssuesClient.java b/src/main/java/com/merge/api/crm/IssuesClient.java index f83ecea1f..f75a516e1 100644 --- a/src/main/java/com/merge/api/crm/IssuesClient.java +++ b/src/main/java/com/merge/api/crm/IssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Issue; import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.IssuesRetrieveRequest; public class IssuesClient { protected final ClientOptions clientOptions; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, request, requestOptions).body(); } } diff --git a/src/main/java/com/merge/api/crm/OpportunitiesClient.java b/src/main/java/com/merge/api/crm/OpportunitiesClient.java index fa961cca7..14af38fde 100644 --- a/src/main/java/com/merge/api/crm/OpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/OpportunitiesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesMetaPatchRetrieveRequest; import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; import com.merge.api.crm.types.OpportunitiesRetrieveRequest; import com.merge.api.crm.types.Opportunity; @@ -114,8 +115,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Opportunity PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, OpportunitiesMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, OpportunitiesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, 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..588dd6d58 100644 --- a/src/main/java/com/merge/api/crm/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/crm/RawAccountTokenClient.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.AccountTokenRetrieveRequest; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..d87d0135b 100644 --- a/src/main/java/com/merge/api/crm/RawAccountsClient.java +++ b/src/main/java/com/merge/api/crm/RawAccountsClient.java @@ -14,6 +14,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Account; import com.merge.api.crm.types.AccountsListRequest; +import com.merge.api.crm.types.AccountsMetaPatchRetrieveRequest; import com.merge.api.crm.types.AccountsRemoteFieldClassesListRequest; import com.merge.api.crm.types.AccountsRetrieveRequest; import com.merge.api.crm.types.CrmAccountEndpointRequest; @@ -25,10 +26,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; import okhttp3.OkHttpClient; @@ -143,27 +141,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -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); } @@ -366,40 +348,45 @@ public MergeApiHttpResponse partialUpdate( * Returns metadata for CRMAccount PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, AccountsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for CRMAccount PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, AccountsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for CRMAccount PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, AccountsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/accounts/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +419,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,10 +511,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsRemoteFieldClassesListRequest nextRequest = AccountsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -538,17 +523,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawAssociationTypesClient.java b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java index 4ad0b8875..325e02735 100644 --- a/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java +++ b/src/main/java/com/merge/api/crm/RawAssociationTypesClient.java @@ -16,15 +16,13 @@ import com.merge.api.crm.types.CrmAssociationTypeEndpointRequest; import com.merge.api.crm.types.CrmAssociationTypeResponse; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesListRequest; +import com.merge.api.crm.types.CustomObjectClassesAssociationTypesMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesAssociationTypesRetrieveRequest; import com.merge.api.crm.types.MetaResponse; 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; import okhttp3.OkHttpClient; @@ -132,10 +130,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationTypeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesAssociationTypesListRequest nextRequest = CustomObjectClassesAssociationTypesListRequest.builder() .from(request) @@ -144,7 +143,7 @@ public MergeApiHttpResponse> customObjectCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), + !startingAfter.isEmpty(), result, parsedResponse, () -> customObjectClassesAssociationTypesList( @@ -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); } @@ -307,42 +294,53 @@ public MergeApiHttpResponse customObjectClassesAssociationTypes */ public MergeApiHttpResponse customObjectClassesAssociationTypesMetaPostRetrieve( String customObjectClassId) { - return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, null); + return customObjectClassesAssociationTypesMetaPostRetrieve( + customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.builder() + .build()); } /** * Returns metadata for CRMAssociationType POSTs. */ public MergeApiHttpResponse customObjectClassesAssociationTypesMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request) { + return customObjectClassesAssociationTypesMetaPostRetrieve(customObjectClassId, request, null); + } + + /** + * Returns metadata for CRMAssociationType POSTs. + */ + public MergeApiHttpResponse customObjectClassesAssociationTypesMetaPostRetrieve( + String customObjectClassId, + CustomObjectClassesAssociationTypesMetaPostRetrieveRequest request, + RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .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() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..0053df16a 100644 --- a/src/main/java/com/merge/api/crm/RawAssociationsClient.java +++ b/src/main/java/com/merge/api/crm/RawAssociationsClient.java @@ -18,7 +18,6 @@ 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; @@ -140,10 +139,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAssociationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsAssociationsListRequest nextRequest = CustomObjectClassesCustomObjectsAssociationsListRequest.builder() .from(request) @@ -152,7 +152,7 @@ public MergeApiHttpResponse> customObjectClasses List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), + !startingAfter.isEmpty(), result, parsedResponse, () -> customObjectClassesCustomObjectsAssociationsList( @@ -160,12 +160,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 +241,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..772f63cad 100644 --- a/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/crm/RawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.crm.types.AsyncPassthroughReciept; +import com.merge.api.crm.types.AsyncPassthroughRetrieveRequest; import com.merge.api.crm.types.AsyncPassthroughRetrieveResponse; import com.merge.api.crm.types.DataPassthroughRequest; import java.io.IOException; @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..f55e361bf 100644 --- a/src/main/java/com/merge/api/crm/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/crm/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..a341a89bb 100644 --- a/src/main/java/com/merge/api/crm/RawContactsClient.java +++ b/src/main/java/com/merge/api/crm/RawContactsClient.java @@ -14,12 +14,13 @@ import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Contact; +import com.merge.api.crm.types.ContactsIgnoreCreateRequest; import com.merge.api.crm.types.ContactsListRequest; +import com.merge.api.crm.types.ContactsMetaPatchRetrieveRequest; import com.merge.api.crm.types.ContactsRemoteFieldClassesListRequest; import com.merge.api.crm.types.ContactsRetrieveRequest; import com.merge.api.crm.types.CrmContactEndpointRequest; import com.merge.api.crm.types.CrmContactResponse; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.PaginatedContactList; import com.merge.api.crm.types.PaginatedRemoteFieldClassList; @@ -27,10 +28,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; import okhttp3.OkHttpClient; @@ -149,27 +147,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -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); } @@ -371,7 +353,7 @@ public MergeApiHttpResponse partialUpdate( /** * 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. */ - public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public MergeApiHttpResponse ignoreCreate(String modelId, ContactsIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -379,7 +361,7 @@ public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModel * 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. */ public MergeApiHttpResponse ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, ContactsIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/contacts/ignore") @@ -388,7 +370,7 @@ public MergeApiHttpResponse ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize 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); } @@ -422,40 +401,45 @@ public MergeApiHttpResponse ignoreCreate( * Returns metadata for CRMContact PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, ContactsMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for CRMContact PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, ContactsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for CRMContact PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, ContactsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/contacts/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +472,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,10 +564,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsRemoteFieldClassesListRequest nextRequest = ContactsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -594,17 +576,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawCustomObjectClassesClient.java b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java index db7d844f2..b7a265e52 100644 --- a/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java +++ b/src/main/java/com/merge/api/crm/RawCustomObjectClassesClient.java @@ -18,7 +18,6 @@ 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; @@ -117,10 +116,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCustomObjectClassList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCustomObjectClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesListRequest nextRequest = CustomObjectClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -128,17 +128,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -194,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(), 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..68292d071 100644 --- a/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java +++ b/src/main/java/com/merge/api/crm/RawCustomObjectsClient.java @@ -16,6 +16,7 @@ import com.merge.api.crm.types.CrmCustomObjectResponse; import com.merge.api.crm.types.CustomObject; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsListRequest; +import com.merge.api.crm.types.CustomObjectClassesCustomObjectsMetaPostRetrieveRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest; import com.merge.api.crm.types.CustomObjectClassesCustomObjectsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -138,10 +136,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCustomObjectList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsListRequest nextRequest = CustomObjectClassesCustomObjectsListRequest.builder() .from(request) @@ -150,7 +149,7 @@ public MergeApiHttpResponse> customObjectClasse List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), + !startingAfter.isEmpty(), result, parsedResponse, () -> customObjectClassesCustomObjectsList( @@ -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); } @@ -316,42 +303,53 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsRetrie */ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPostRetrieve( String customObjectClassId) { - return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, null); + return customObjectClassesCustomObjectsMetaPostRetrieve( + customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.builder() + .build()); + } + + /** + * Returns metadata for CRMCustomObject POSTs. + */ + public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPostRetrieve( + String customObjectClassId, CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request) { + return customObjectClassesCustomObjectsMetaPostRetrieve(customObjectClassId, request, null); } /** * Returns metadata for CRMCustomObject POSTs. */ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPostRetrieve( - String customObjectClassId, RequestOptions requestOptions) { + String customObjectClassId, + CustomObjectClassesCustomObjectsMetaPostRetrieveRequest request, + RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .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() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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,10 +440,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest nextRequest = CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.builder() .from(request) @@ -454,7 +453,7 @@ public MergeApiHttpResponse customObjectClassesCustomObjectsMetaPo List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), + !startingAfter.isEmpty(), result, parsedResponse, () -> customObjectClassesCustomObjectsRemoteFieldClassesList( @@ -462,12 +461,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..6c12f96a5 100644 --- a/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java +++ b/src/main/java/com/merge/api/crm/RawEngagementTypesClient.java @@ -21,7 +21,6 @@ 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; @@ -123,10 +122,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementTypeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementTypesListRequest nextRequest = EngagementTypesListRequest.builder() .from(request) .cursor(startingAfter) @@ -134,17 +134,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -203,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(), 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,10 +291,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementTypesRemoteFieldClassesListRequest nextRequest = EngagementTypesRemoteFieldClassesListRequest.builder() .from(request) @@ -310,17 +304,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawEngagementsClient.java b/src/main/java/com/merge/api/crm/RawEngagementsClient.java index 40b6e4a90..f04adc804 100644 --- a/src/main/java/com/merge/api/crm/RawEngagementsClient.java +++ b/src/main/java/com/merge/api/crm/RawEngagementsClient.java @@ -16,6 +16,7 @@ import com.merge.api.crm.types.EngagementEndpointRequest; import com.merge.api.crm.types.EngagementResponse; import com.merge.api.crm.types.EngagementsListRequest; +import com.merge.api.crm.types.EngagementsMetaPatchRetrieveRequest; import com.merge.api.crm.types.EngagementsRemoteFieldClassesListRequest; import com.merge.api.crm.types.EngagementsRetrieveRequest; import com.merge.api.crm.types.MetaResponse; @@ -25,10 +26,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; import okhttp3.OkHttpClient; @@ -143,28 +141,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEngagementList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementsListRequest nextRequest = EngagementsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -193,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); } @@ -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(), 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 +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(), 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 +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); } @@ -348,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(), 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); } @@ -367,40 +348,47 @@ public MergeApiHttpResponse partialUpdate( * Returns metadata for Engagement PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, EngagementsMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Engagement PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, EngagementsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Engagement PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve( + String id, EngagementsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/engagements/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +421,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,10 +513,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EngagementsRemoteFieldClassesListRequest nextRequest = EngagementsRemoteFieldClassesListRequest.builder() .from(request) @@ -540,17 +526,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawFieldMappingClient.java b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java index ee9a91ba4..36fddab2e 100644 --- a/src/main/java/com/merge/api/crm/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/crm/RawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.crm.types.ExternalTargetFieldApiResponse; import com.merge.api.crm.types.FieldMappingApiInstanceResponse; import com.merge.api.crm.types.FieldMappingInstanceResponse; +import com.merge.api.crm.types.FieldMappingsDestroyRequest; import com.merge.api.crm.types.FieldMappingsRetrieveRequest; import com.merge.api.crm.types.PatchedEditFieldMappingRequest; 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 +79,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 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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 +302,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 +342,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..8badeef6e 100644 --- a/src/main/java/com/merge/api/crm/RawIssuesClient.java +++ b/src/main/java/com/merge/api/crm/RawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.Issue; import com.merge.api.crm.types.IssuesListRequest; +import com.merge.api.crm.types.IssuesRetrieveRequest; import com.merge.api.crm.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; @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..359c818ec 100644 --- a/src/main/java/com/merge/api/crm/RawLeadsClient.java +++ b/src/main/java/com/merge/api/crm/RawLeadsClient.java @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -160,27 +157,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLeadList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LeadsListRequest nextRequest = LeadsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -208,12 +202,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 +222,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 +290,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 +329,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,10 +421,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LeadsRemoteFieldClassesListRequest nextRequest = LeadsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -449,17 +433,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawLinkTokenClient.java b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java index 4bf0eeedd..5b96215c0 100644 --- a/src/main/java/com/merge/api/crm/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/crm/RawLinkTokenClient.java @@ -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..e992e676f 100644 --- a/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/crm/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/RawNotesClient.java b/src/main/java/com/merge/api/crm/RawNotesClient.java index bc3f772e8..8c3a1f9b1 100644 --- a/src/main/java/com/merge/api/crm/RawNotesClient.java +++ b/src/main/java/com/merge/api/crm/RawNotesClient.java @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -150,27 +147,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedNoteList.class); + String startingAfter = parsedResponse.getNext().orElse(null); NotesListRequest nextRequest = NotesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -198,12 +192,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 +212,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 +280,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 +319,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,10 +411,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); NotesRemoteFieldClassesListRequest nextRequest = NotesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -439,17 +423,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawOpportunitiesClient.java b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java index fabefdb7b..85239db58 100644 --- a/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java +++ b/src/main/java/com/merge/api/crm/RawOpportunitiesClient.java @@ -14,6 +14,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.crm.types.MetaResponse; import com.merge.api.crm.types.OpportunitiesListRequest; +import com.merge.api.crm.types.OpportunitiesMetaPatchRetrieveRequest; import com.merge.api.crm.types.OpportunitiesRemoteFieldClassesListRequest; import com.merge.api.crm.types.OpportunitiesRetrieveRequest; import com.merge.api.crm.types.Opportunity; @@ -25,10 +26,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; import okhttp3.OkHttpClient; @@ -166,10 +164,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedOpportunityList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OpportunitiesListRequest nextRequest = OpportunitiesListRequest.builder() .from(request) .cursor(startingAfter) @@ -177,17 +176,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -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); } @@ -401,40 +381,47 @@ public MergeApiHttpResponse partialUpdate( * Returns metadata for Opportunity PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve( + id, OpportunitiesMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Opportunity PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, OpportunitiesMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Opportunity PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve( + String id, OpportunitiesMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/opportunities/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +454,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,10 +546,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); OpportunitiesRemoteFieldClassesListRequest nextRequest = OpportunitiesRemoteFieldClassesListRequest.builder() .from(request) @@ -574,17 +559,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/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..96e3111a1 100644 --- a/src/main/java/com/merge/api/crm/RawStagesClient.java +++ b/src/main/java/com/merge/api/crm/RawStagesClient.java @@ -21,7 +21,6 @@ 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; @@ -123,27 +122,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedStageList.class); + String startingAfter = parsedResponse.getNext().orElse(null); StagesListRequest nextRequest = StagesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -202,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(), 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,10 +290,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); StagesRemoteFieldClassesListRequest nextRequest = StagesRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -308,17 +302,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawSyncStatusClient.java b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java index 47e8ab767..246b359e1 100644 --- a/src/main/java/com/merge/api/crm/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/crm/RawSyncStatusClient.java @@ -69,17 +69,14 @@ public MergeApiHttpResponse list( } try (Response response = client.newCall(okhttpRequest).execute()) { ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new MergeApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBody.string(), PaginatedSyncStatusList.class), + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..cd0c70b57 100644 --- a/src/main/java/com/merge/api/crm/RawTasksClient.java +++ b/src/main/java/com/merge/api/crm/RawTasksClient.java @@ -21,14 +21,12 @@ import com.merge.api.crm.types.TaskEndpointRequest; import com.merge.api.crm.types.TaskResponse; import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksMetaPatchRetrieveRequest; import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; 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; import okhttp3.OkHttpClient; @@ -135,27 +133,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTaskList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TasksListRequest nextRequest = TasksListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -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); } @@ -356,40 +338,45 @@ public MergeApiHttpResponse partialUpdate( * Returns metadata for Task PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, TasksMetaPatchRetrieveRequest.builder().build()); + } + + /** + * Returns metadata for Task PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve(String id, TasksMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); } /** * Returns metadata for Task PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve( + String id, TasksMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/tasks/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +409,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,10 +501,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TasksRemoteFieldClassesListRequest nextRequest = TasksRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -528,17 +513,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/RawUsersClient.java b/src/main/java/com/merge/api/crm/RawUsersClient.java index 0c0162460..a2b2b9272 100644 --- a/src/main/java/com/merge/api/crm/RawUsersClient.java +++ b/src/main/java/com/merge/api/crm/RawUsersClient.java @@ -13,18 +13,17 @@ import com.merge.api.core.QueryStringMapper; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.PaginatedRemoteFieldClassList; import com.merge.api.crm.types.PaginatedUserList; import com.merge.api.crm.types.RemoteFieldClass; import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersIgnoreCreateRequest; import com.merge.api.crm.types.UsersListRequest; import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; import com.merge.api.crm.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; @@ -131,27 +130,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -209,16 +205,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); } @@ -227,7 +220,7 @@ public MergeApiHttpResponse retrieve(String id, UsersRetrieveRequest reque /** * 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. */ - public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public MergeApiHttpResponse ignoreCreate(String modelId, UsersIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -235,7 +228,7 @@ public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModel * 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. */ public MergeApiHttpResponse ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, UsersIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("crm/v1/users/ignore") @@ -244,7 +237,7 @@ public MergeApiHttpResponse ignoreCreate( RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize request", e); } @@ -264,11 +257,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,10 +344,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); UsersRemoteFieldClassesListRequest nextRequest = UsersRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -365,17 +356,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/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/TasksClient.java b/src/main/java/com/merge/api/crm/TasksClient.java index 7b7f59ecb..4f4c57f2e 100644 --- a/src/main/java/com/merge/api/crm/TasksClient.java +++ b/src/main/java/com/merge/api/crm/TasksClient.java @@ -13,6 +13,7 @@ import com.merge.api.crm.types.TaskEndpointRequest; import com.merge.api.crm.types.TaskResponse; import com.merge.api.crm.types.TasksListRequest; +import com.merge.api.crm.types.TasksMetaPatchRetrieveRequest; import com.merge.api.crm.types.TasksRemoteFieldClassesListRequest; import com.merge.api.crm.types.TasksRetrieveRequest; @@ -113,8 +114,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Task PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, TasksMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Task PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, TasksMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/crm/UsersClient.java b/src/main/java/com/merge/api/crm/UsersClient.java index 1afed99fb..8c7fae374 100644 --- a/src/main/java/com/merge/api/crm/UsersClient.java +++ b/src/main/java/com/merge/api/crm/UsersClient.java @@ -6,9 +6,9 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.core.SyncPagingIterable; -import com.merge.api.crm.types.IgnoreCommonModelRequest; import com.merge.api.crm.types.RemoteFieldClass; import com.merge.api.crm.types.User; +import com.merge.api.crm.types.UsersIgnoreCreateRequest; import com.merge.api.crm.types.UsersListRequest; import com.merge.api.crm.types.UsersRemoteFieldClassesListRequest; import com.merge.api.crm.types.UsersRetrieveRequest; @@ -75,14 +75,14 @@ public User retrieve(String id, UsersRetrieveRequest request, RequestOptions req /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public void ignoreCreate(String modelId, UsersIgnoreCreateRequest request) { this.rawClient.ignoreCreate(modelId, request).body(); } /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + public void ignoreCreate(String modelId, UsersIgnoreCreateRequest request, RequestOptions requestOptions) { this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); } diff --git a/src/main/java/com/merge/api/crm/types/Account.java b/src/main/java/com/merge/api/crm/types/Account.java index 4e9c6f97d..643d1f924 100644 --- a/src/main/java/com/merge/api/crm/types/Account.java +++ b/src/main/java/com/merge/api/crm/types/Account.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -114,8 +117,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -138,48 +144,66 @@ public Optional getModifiedAt() { /** * @return The account's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The account's industry. */ - @JsonProperty("industry") + @JsonIgnore public Optional getIndustry() { + if (industry == null) { + return Optional.empty(); + } return industry; } /** * @return The account's website. */ - @JsonProperty("website") + @JsonIgnore public Optional getWebsite() { + if (website == null) { + return Optional.empty(); + } return website; } /** * @return The account's number of employees. */ - @JsonProperty("number_of_employees") + @JsonIgnore public Optional getNumberOfEmployees() { + if (numberOfEmployees == null) { + return Optional.empty(); + } return numberOfEmployees; } @@ -196,24 +220,33 @@ public Optional> getPhoneNumbers() { /** * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } /** * @return When the CRM system account data was last modified by a user with a login. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the third party's account was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -225,13 +258,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -240,6 +279,78 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("industry") + private Optional _getIndustry() { + return industry; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("website") + private Optional _getWebsite() { + return website; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number_of_employees") + private Optional _getNumberOfEmployees() { + return numberOfEmployees; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -399,6 +510,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -441,6 +563,17 @@ public Builder owner(AccountOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The account's name.

          */ @@ -455,6 +588,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The account's description.

          */ @@ -469,6 +613,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The account's industry.

          */ @@ -483,6 +638,17 @@ public Builder industry(String industry) { return this; } + public Builder industry(Nullable industry) { + if (industry.isNull()) { + this.industry = null; + } else if (industry.isEmpty()) { + this.industry = Optional.empty(); + } else { + this.industry = Optional.of(industry.get()); + } + return this; + } + /** *

          The account's website.

          */ @@ -497,6 +663,17 @@ public Builder website(String website) { return this; } + public Builder website(Nullable website) { + if (website.isNull()) { + this.website = null; + } else if (website.isEmpty()) { + this.website = Optional.empty(); + } else { + this.website = Optional.of(website.get()); + } + return this; + } + /** *

          The account's number of employees.

          */ @@ -511,6 +688,17 @@ public Builder numberOfEmployees(Integer numberOfEmployees) { return this; } + public Builder numberOfEmployees(Nullable numberOfEmployees) { + if (numberOfEmployees.isNull()) { + this.numberOfEmployees = null; + } else if (numberOfEmployees.isEmpty()) { + this.numberOfEmployees = Optional.empty(); + } else { + this.numberOfEmployees = Optional.of(numberOfEmployees.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -547,6 +735,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + /** *

          When the CRM system account data was last modified by a user with a login.

          */ @@ -561,6 +760,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

          When the third party's account was created.

          */ @@ -575,6 +785,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

          */ @@ -600,6 +821,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -611,6 +843,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..215c04bbe 100644 --- a/src/main/java/com/merge/api/crm/types/AccountDetails.java +++ b/src/main/java/com/merge/api/crm/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(AccountDetailsCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..770a1aff0 100644 --- a/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/crm/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/crm/types/AccountIntegration.java b/src/main/java/com/merge/api/crm/types/AccountIntegration.java index 61d16d4b1..1532f95e1 100644 --- a/src/main/java/com/merge/api/crm/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/crm/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

          Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

          */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

          Company logo in square shape.

          */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

          The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

          */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

          Category or categories this integration is in beta status for.

          */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

          Company logo in square shape.

          * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

          Company logo in rectangular shape.

          * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/crm/types/AccountRequest.java b/src/main/java/com/merge/api/crm/types/AccountRequest.java index 4779d0e87..7f076cb22 100644 --- a/src/main/java/com/merge/api/crm/types/AccountRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,48 +80,66 @@ private AccountRequest( /** * @return The account's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The account's industry. */ - @JsonProperty("industry") + @JsonIgnore public Optional getIndustry() { + if (industry == null) { + return Optional.empty(); + } return industry; } /** * @return The account's website. */ - @JsonProperty("website") + @JsonIgnore public Optional getWebsite() { + if (website == null) { + return Optional.empty(); + } return website; } /** * @return The account's number of employees. */ - @JsonProperty("number_of_employees") + @JsonIgnore public Optional getNumberOfEmployees() { + if (numberOfEmployees == null) { + return Optional.empty(); + } return numberOfEmployees; } @@ -130,18 +151,27 @@ public Optional> getAddresses() { /** * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -150,6 +180,60 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("industry") + private Optional _getIndustry() { + return industry; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("website") + private Optional _getWebsite() { + return website; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number_of_employees") + private Optional _getNumberOfEmployees() { + return numberOfEmployees; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -258,6 +342,17 @@ public Builder owner(AccountRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The account's name.

          */ @@ -272,6 +367,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The account's description.

          */ @@ -286,6 +392,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The account's industry.

          */ @@ -300,6 +417,17 @@ public Builder industry(String industry) { return this; } + public Builder industry(Nullable industry) { + if (industry.isNull()) { + this.industry = null; + } else if (industry.isEmpty()) { + this.industry = Optional.empty(); + } else { + this.industry = Optional.of(industry.get()); + } + return this; + } + /** *

          The account's website.

          */ @@ -314,6 +442,17 @@ public Builder website(String website) { return this; } + public Builder website(Nullable website) { + if (website.isNull()) { + this.website = null; + } else if (website.isEmpty()) { + this.website = Optional.empty(); + } else { + this.website = Optional.of(website.get()); + } + return this; + } + /** *

          The account's number of employees.

          */ @@ -328,6 +467,17 @@ public Builder numberOfEmployees(Integer numberOfEmployees) { return this; } + public Builder numberOfEmployees(Nullable numberOfEmployees) { + if (numberOfEmployees.isNull()) { + this.numberOfEmployees = null; + } else if (numberOfEmployees.isEmpty()) { + this.numberOfEmployees = Optional.empty(); + } else { + this.numberOfEmployees = Optional.of(numberOfEmployees.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -353,6 +503,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -364,6 +525,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -375,6 +547,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..0512b5d9e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(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..b5786897a 100644 --- a/src/main/java/com/merge/api/crm/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountsListRequest.Builder.class) public final class AccountsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -54,7 +57,7 @@ public final class AccountsListRequest { private final Map additionalProperties; private AccountsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -90,7 +93,7 @@ private AccountsListRequest( * @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; } @@ -169,8 +172,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return accounts with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -193,8 +199,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -256,7 +277,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 createdAfter = Optional.empty(); @@ -311,17 +332,17 @@ public Builder from(AccountsListRequest 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(AccountsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -466,6 +487,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          If provided, will only return accounts with this owner.

          */ @@ -508,6 +540,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public AccountsListRequest build() { return new AccountsListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/AccountsListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/AccountsListRequestExpandItem.java new file mode 100644 index 000000000..c148b1c5a --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountsListRequestExpandItem.java @@ -0,0 +1,74 @@ +/** + * 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 AccountsListRequestExpandItem { + public static final AccountsListRequestExpandItem OWNER = new AccountsListRequestExpandItem(Value.OWNER, "owner"); + + private final Value value; + + private final String string; + + AccountsListRequestExpandItem(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 AccountsListRequestExpandItem + && this.string.equals(((AccountsListRequestExpandItem) 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 UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountsListRequestExpandItem valueOf(String value) { + switch (value) { + case "owner": + return OWNER; + default: + return new AccountsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + OWNER, + + UNKNOWN + } + + public interface Visitor { + T visitOwner(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/AccountsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/AccountsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..8bf2e1f58 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountsMetaPatchRetrieveRequest.Builder.class) +public final class AccountsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private AccountsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountsMetaPatchRetrieveRequest other) { + return this; + } + + public AccountsMetaPatchRetrieveRequest build() { + return new AccountsMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..c3f3a91a2 100644 --- a/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ diff --git a/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java index 34492d31b..be9f0974c 100644 --- a/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AccountsRetrieveRequest.Builder.class) public final class AccountsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -33,7 +33,7 @@ public final class AccountsRetrieveRequest { private final Map additionalProperties; private AccountsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeRemoteFields, Optional includeShellData, @@ -49,7 +49,7 @@ private AccountsRetrieveRequest( * @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; } @@ -111,7 +111,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(); @@ -136,17 +136,17 @@ public Builder from(AccountsRetrieveRequest 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(AccountsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..162f56607 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AccountsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AccountsRetrieveRequestExpandItem { + public static final AccountsRetrieveRequestExpandItem OWNER = + new AccountsRetrieveRequestExpandItem(Value.OWNER, "owner"); + + private final Value value; + + private final String string; + + AccountsRetrieveRequestExpandItem(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 AccountsRetrieveRequestExpandItem + && this.string.equals(((AccountsRetrieveRequestExpandItem) 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 UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AccountsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "owner": + return OWNER; + default: + return new AccountsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + OWNER, + + UNKNOWN + } + + public interface Visitor { + T visitOwner(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/Address.java b/src/main/java/com/merge/api/crm/types/Address.java index d2412c603..92f1f1954 100644 --- a/src/main/java/com/merge/api/crm/types/Address.java +++ b/src/main/java/com/merge/api/crm/types/Address.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -83,40 +86,55 @@ public Optional getModifiedAt() { /** * @return Line 1 of the address's street. */ - @JsonProperty("street_1") + @JsonIgnore public Optional getStreet1() { + if (street1 == null) { + return Optional.empty(); + } return street1; } /** * @return Line 2 of the address's street. */ - @JsonProperty("street_2") + @JsonIgnore public Optional getStreet2() { + if (street2 == null) { + return Optional.empty(); + } return street2; } /** * @return The address's city. */ - @JsonProperty("city") + @JsonIgnore public Optional getCity() { + if (city == null) { + return Optional.empty(); + } return city; } /** * @return The address's state. */ - @JsonProperty("state") + @JsonIgnore public Optional getState() { + if (state == null) { + return Optional.empty(); + } return state; } /** * @return The address's postal code. */ - @JsonProperty("postal_code") + @JsonIgnore public Optional getPostalCode() { + if (postalCode == null) { + return Optional.empty(); + } return postalCode; } @@ -374,8 +392,11 @@ public Optional getPostalCode() { *
        • ZW - Zimbabwe
        • *
        */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } @@ -386,8 +407,53 @@ public Optional getCountry() { *
      • SHIPPING - SHIPPING
      • *
      */ - @JsonProperty("address_type") + @JsonIgnore public Optional getAddressType() { + if (addressType == null) { + return Optional.empty(); + } + return addressType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_1") + private Optional _getStreet1() { + return street1; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_2") + private Optional _getStreet2() { + return street2; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("city") + private Optional _getCity() { + return city; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("state") + private Optional _getState() { + return state; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("postal_code") + private Optional _getPostalCode() { + return postalCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("address_type") + private Optional _getAddressType() { return addressType; } @@ -517,6 +583,17 @@ public Builder street1(String street1) { return this; } + public Builder street1(Nullable street1) { + if (street1.isNull()) { + this.street1 = null; + } else if (street1.isEmpty()) { + this.street1 = Optional.empty(); + } else { + this.street1 = Optional.of(street1.get()); + } + return this; + } + /** *

      Line 2 of the address's street.

      */ @@ -531,6 +608,17 @@ public Builder street2(String street2) { return this; } + public Builder street2(Nullable street2) { + if (street2.isNull()) { + this.street2 = null; + } else if (street2.isEmpty()) { + this.street2 = Optional.empty(); + } else { + this.street2 = Optional.of(street2.get()); + } + return this; + } + /** *

      The address's city.

      */ @@ -545,6 +633,17 @@ public Builder city(String city) { return this; } + public Builder city(Nullable city) { + if (city.isNull()) { + this.city = null; + } else if (city.isEmpty()) { + this.city = Optional.empty(); + } else { + this.city = Optional.of(city.get()); + } + return this; + } + /** *

      The address's state.

      */ @@ -559,6 +658,17 @@ public Builder state(String state) { return this; } + public Builder state(Nullable state) { + if (state.isNull()) { + this.state = null; + } else if (state.isEmpty()) { + this.state = Optional.empty(); + } else { + this.state = Optional.of(state.get()); + } + return this; + } + /** *

      The address's postal code.

      */ @@ -573,6 +683,17 @@ public Builder postalCode(String postalCode) { return this; } + public Builder postalCode(Nullable postalCode) { + if (postalCode.isNull()) { + this.postalCode = null; + } else if (postalCode.isEmpty()) { + this.postalCode = Optional.empty(); + } else { + this.postalCode = Optional.of(postalCode.get()); + } + return this; + } + /** *

      The address's country.

      *
        @@ -838,6 +959,17 @@ public Builder country(AddressCountry country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

        The address type.

        *
          @@ -856,6 +988,17 @@ public Builder addressType(AddressAddressType addressType) { return this; } + public Builder addressType(Nullable addressType) { + if (addressType.isNull()) { + this.addressType = null; + } else if (addressType.isEmpty()) { + this.addressType = Optional.empty(); + } else { + this.addressType = Optional.of(addressType.get()); + } + return this; + } + public Address build() { return new Address( createdAt, diff --git a/src/main/java/com/merge/api/crm/types/AddressRequest.java b/src/main/java/com/merge/api/crm/types/AddressRequest.java index e01cab9d3..5fe658724 100644 --- a/src/main/java/com/merge/api/crm/types/AddressRequest.java +++ b/src/main/java/com/merge/api/crm/types/AddressRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -67,40 +70,55 @@ private AddressRequest( /** * @return Line 1 of the address's street. */ - @JsonProperty("street_1") + @JsonIgnore public Optional getStreet1() { + if (street1 == null) { + return Optional.empty(); + } return street1; } /** * @return Line 2 of the address's street. */ - @JsonProperty("street_2") + @JsonIgnore public Optional getStreet2() { + if (street2 == null) { + return Optional.empty(); + } return street2; } /** * @return The address's city. */ - @JsonProperty("city") + @JsonIgnore public Optional getCity() { + if (city == null) { + return Optional.empty(); + } return city; } /** * @return The address's state. */ - @JsonProperty("state") + @JsonIgnore public Optional getState() { + if (state == null) { + return Optional.empty(); + } return state; } /** * @return The address's postal code. */ - @JsonProperty("postal_code") + @JsonIgnore public Optional getPostalCode() { + if (postalCode == null) { + return Optional.empty(); + } return postalCode; } @@ -358,8 +376,11 @@ public Optional getPostalCode() { *
        • ZW - Zimbabwe
        • *
        */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } @@ -370,18 +391,81 @@ public Optional getCountry() { *
      • SHIPPING - SHIPPING
      • *
      */ - @JsonProperty("address_type") + @JsonIgnore public Optional getAddressType() { + if (addressType == null) { + return Optional.empty(); + } return addressType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_1") + private Optional _getStreet1() { + return street1; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_2") + private Optional _getStreet2() { + return street2; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("city") + private Optional _getCity() { + return city; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("state") + private Optional _getState() { + return state; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("postal_code") + private Optional _getPostalCode() { + return postalCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("address_type") + private Optional _getAddressType() { + return addressType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -483,6 +567,17 @@ public Builder street1(String street1) { return this; } + public Builder street1(Nullable street1) { + if (street1.isNull()) { + this.street1 = null; + } else if (street1.isEmpty()) { + this.street1 = Optional.empty(); + } else { + this.street1 = Optional.of(street1.get()); + } + return this; + } + /** *

      Line 2 of the address's street.

      */ @@ -497,6 +592,17 @@ public Builder street2(String street2) { return this; } + public Builder street2(Nullable street2) { + if (street2.isNull()) { + this.street2 = null; + } else if (street2.isEmpty()) { + this.street2 = Optional.empty(); + } else { + this.street2 = Optional.of(street2.get()); + } + return this; + } + /** *

      The address's city.

      */ @@ -511,6 +617,17 @@ public Builder city(String city) { return this; } + public Builder city(Nullable city) { + if (city.isNull()) { + this.city = null; + } else if (city.isEmpty()) { + this.city = Optional.empty(); + } else { + this.city = Optional.of(city.get()); + } + return this; + } + /** *

      The address's state.

      */ @@ -525,6 +642,17 @@ public Builder state(String state) { return this; } + public Builder state(Nullable state) { + if (state.isNull()) { + this.state = null; + } else if (state.isEmpty()) { + this.state = Optional.empty(); + } else { + this.state = Optional.of(state.get()); + } + return this; + } + /** *

      The address's postal code.

      */ @@ -539,6 +667,17 @@ public Builder postalCode(String postalCode) { return this; } + public Builder postalCode(Nullable postalCode) { + if (postalCode.isNull()) { + this.postalCode = null; + } else if (postalCode.isEmpty()) { + this.postalCode = Optional.empty(); + } else { + this.postalCode = Optional.of(postalCode.get()); + } + return this; + } + /** *

      The address's country.

      *
        @@ -804,6 +943,17 @@ public Builder country(AddressRequestCountry country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

        The address type.

        *
          @@ -822,6 +972,17 @@ public Builder addressType(AddressRequestAddressType addressType) { return this; } + public Builder addressType(Nullable addressType) { + if (addressType.isNull()) { + this.addressType = null; + } else if (addressType.isEmpty()) { + this.addressType = Optional.empty(); + } else { + this.addressType = Optional.of(addressType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -833,6 +994,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -844,6 +1016,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AddressRequest build() { return new AddressRequest( street1, diff --git a/src/main/java/com/merge/api/crm/types/Association.java b/src/main/java/com/merge/api/crm/types/Association.java index d0b9729dc..681bf9619 100644 --- a/src/main/java/com/merge/api/crm/types/Association.java +++ b/src/main/java/com/merge/api/crm/types/Association.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,8 +80,17 @@ public Optional getTargetObject() { /** * @return The association type the association belongs to. */ - @JsonProperty("association_type") + @JsonIgnore public Optional getAssociationType() { + if (associationType == null) { + return Optional.empty(); + } + return associationType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("association_type") + private Optional _getAssociationType() { return associationType; } @@ -206,6 +218,17 @@ public Builder associationType(AssociationAssociationType associationType) { return this; } + public Builder associationType(Nullable associationType) { + if (associationType.isNull()) { + this.associationType = null; + } else if (associationType.isEmpty()) { + this.associationType = Optional.empty(); + } else { + this.associationType = Optional.of(associationType.get()); + } + return this; + } + public Association build() { return new Association( createdAt, modifiedAt, sourceObject, targetObject, associationType, additionalProperties); diff --git a/src/main/java/com/merge/api/crm/types/AssociationSubType.java b/src/main/java/com/merge/api/crm/types/AssociationSubType.java index ce586153e..242bed1e4 100644 --- a/src/main/java/com/merge/api/crm/types/AssociationSubType.java +++ b/src/main/java/com/merge/api/crm/types/AssociationSubType.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -44,8 +47,11 @@ private AssociationSubType( this.additionalProperties = additionalProperties; } - @JsonProperty("id") + @JsonIgnore public Optional getId() { + if (id == null) { + return Optional.empty(); + } return id; } @@ -65,8 +71,23 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("origin_type") + @JsonIgnore public Optional getOriginType() { + if (originType == null) { + return Optional.empty(); + } + return originType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("id") + private Optional _getId() { + return id; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("origin_type") + private Optional _getOriginType() { return originType; } @@ -136,6 +157,17 @@ public Builder id(String id) { return this; } + public Builder id(Nullable id) { + if (id.isNull()) { + this.id = null; + } else if (id.isEmpty()) { + this.id = Optional.empty(); + } else { + this.id = Optional.of(id.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -175,6 +207,17 @@ public Builder originType(String originType) { return this; } + public Builder originType(Nullable originType) { + if (originType.isNull()) { + this.originType = null; + } else if (originType.isEmpty()) { + this.originType = Optional.empty(); + } else { + this.originType = Optional.of(originType.get()); + } + return this; + } + public AssociationSubType build() { return new AssociationSubType(id, createdAt, modifiedAt, originType, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/AssociationType.java b/src/main/java/com/merge/api/crm/types/AssociationType.java index 3d74bd4e4..3be693d46 100644 --- a/src/main/java/com/merge/api/crm/types/AssociationType.java +++ b/src/main/java/com/merge/api/crm/types/AssociationType.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -112,18 +118,27 @@ public Optional> getTargetObjectClasses() { return targetObjectClasses; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } return displayName; } - @JsonProperty("cardinality") + @JsonIgnore public Optional getCardinality() { + if (cardinality == null) { + return Optional.empty(); + } return cardinality; } @@ -132,6 +147,30 @@ public Optional getIsRequired() { return isRequired; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("cardinality") + private Optional _getCardinality() { + return cardinality; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -246,6 +285,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -310,6 +360,17 @@ public Builder remoteKeyName(String remoteKeyName) { return this; } + public Builder remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public Builder displayName(Optional displayName) { this.displayName = displayName; @@ -321,6 +382,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + @JsonSetter(value = "cardinality", nulls = Nulls.SKIP) public Builder cardinality(Optional cardinality) { this.cardinality = cardinality; @@ -332,6 +404,17 @@ public Builder cardinality(AssociationTypeCardinality cardinality) { return this; } + public Builder cardinality(Nullable cardinality) { + if (cardinality.isNull()) { + this.cardinality = null; + } else if (cardinality.isEmpty()) { + this.cardinality = Optional.empty(); + } else { + this.cardinality = Optional.of(cardinality.get()); + } + return this; + } + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) public Builder isRequired(Optional isRequired) { this.isRequired = isRequired; diff --git a/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..512591950 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(additionalProperties); + } + } +} 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..69dbcf25c 100644 --- a/src/main/java/com/merge/api/crm/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/crm/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

          The User's email at the time of this Event occurring.

          */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/crm/types/Contact.java b/src/main/java/com/merge/api/crm/types/Contact.java index 9a1cdac4e..41d60dabb 100644 --- a/src/main/java/com/merge/api/crm/types/Contact.java +++ b/src/main/java/com/merge/api/crm/types/Contact.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,32 +136,44 @@ public Optional getModifiedAt() { /** * @return The contact's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The contact's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The contact's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } @@ -177,16 +195,22 @@ public Optional> getPhoneNumbers() { /** * @return When the contact's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } /** * @return When the third party's contact was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -198,13 +222,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -213,6 +243,60 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -362,6 +446,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -404,6 +499,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The contact's last name.

          */ @@ -418,6 +524,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

          The contact's account.

          */ @@ -432,6 +549,17 @@ public Builder account(ContactAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

          The contact's owner.

          */ @@ -446,6 +574,17 @@ public Builder owner(ContactOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -493,6 +632,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + /** *

          When the third party's contact was created.

          */ @@ -507,6 +657,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

          */ @@ -532,6 +693,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -543,6 +715,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/ContactRequest.java b/src/main/java/com/merge/api/crm/types/ContactRequest.java index a86d5b785..9ddd31d26 100644 --- a/src/main/java/com/merge/api/crm/types/ContactRequest.java +++ b/src/main/java/com/merge/api/crm/types/ContactRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,32 +80,44 @@ private ContactRequest( /** * @return The contact's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The contact's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The contact's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } @@ -124,18 +139,27 @@ public Optional> getPhoneNumbers() { /** * @return When the contact's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -144,6 +168,48 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -252,6 +318,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The contact's last name.

          */ @@ -266,6 +343,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

          The contact's account.

          */ @@ -280,6 +368,17 @@ public Builder account(ContactRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

          The contact's owner.

          */ @@ -294,6 +393,17 @@ public Builder owner(ContactRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -341,6 +451,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -352,6 +473,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -363,6 +495,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/ContactsIgnoreCreateRequest.java b/src/main/java/com/merge/api/crm/types/ContactsIgnoreCreateRequest.java new file mode 100644 index 000000000..9943dcbb5 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsIgnoreCreateRequest.java @@ -0,0 +1,102 @@ +/** + * 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 = ContactsIgnoreCreateRequest.Builder.class) +public final class ContactsIgnoreCreateRequest { + private final IgnoreCommonModelRequest body; + + private final Map additionalProperties; + + private ContactsIgnoreCreateRequest(IgnoreCommonModelRequest body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public IgnoreCommonModelRequest getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsIgnoreCreateRequest && equalTo((ContactsIgnoreCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ContactsIgnoreCreateRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyStage builder() { + return new Builder(); + } + + public interface BodyStage { + _FinalStage body(@NotNull IgnoreCommonModelRequest body); + + Builder from(ContactsIgnoreCreateRequest other); + } + + public interface _FinalStage { + ContactsIgnoreCreateRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private IgnoreCommonModelRequest body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ContactsIgnoreCreateRequest other) { + body(other.getBody()); + return this; + } + + @java.lang.Override + @JsonSetter("body") + public _FinalStage body(@NotNull IgnoreCommonModelRequest body) { + this.body = body; + return this; + } + + @java.lang.Override + public ContactsIgnoreCreateRequest build() { + return new ContactsIgnoreCreateRequest(body, additionalProperties); + } + } +} 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..dcd005022 100644 --- a/src/main/java/com/merge/api/crm/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/ContactsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -205,8 +208,17 @@ public Optional getPhoneNumbers() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -539,6 +551,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public ContactsListRequest build() { return new ContactsListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/ContactsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/ContactsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..ce0c635b0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/ContactsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ContactsMetaPatchRetrieveRequest.Builder.class) +public final class ContactsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private ContactsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ContactsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(ContactsMetaPatchRetrieveRequest other) { + return this; + } + + public ContactsMetaPatchRetrieveRequest build() { + return new ContactsMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..0143aeef1 100644 --- a/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/ContactsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ diff --git a/src/main/java/com/merge/api/crm/types/CustomObject.java b/src/main/java/com/merge/api/crm/types/CustomObject.java index fdd413877..7f43712bb 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObject.java +++ b/src/main/java/com/merge/api/crm/types/CustomObject.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -66,8 +69,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -90,8 +96,11 @@ public Optional getModifiedAt() { /** * @return The custom object class the custom object record belongs to. */ - @JsonProperty("object_class") + @JsonIgnore public Optional getObjectClass() { + if (objectClass == null) { + return Optional.empty(); + } return objectClass; } @@ -108,6 +117,18 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("object_class") + private Optional _getObjectClass() { + return objectClass; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -207,6 +228,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -249,6 +281,17 @@ public Builder objectClass(String objectClass) { return this; } + public Builder objectClass(Nullable objectClass) { + if (objectClass.isNull()) { + this.objectClass = null; + } else if (objectClass.isEmpty()) { + this.objectClass = Optional.empty(); + } else { + this.objectClass = Optional.of(objectClass.get()); + } + return this; + } + /** *

          The fields and values contained within the custom object record.

          */ diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClass.java b/src/main/java/com/merge/api/crm/types/CustomObjectClass.java index 9e33155aa..527929725 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClass.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClass.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -92,16 +98,22 @@ public Optional getModifiedAt() { /** * @return The custom object class's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The custom object class's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -121,8 +133,35 @@ public Optional> getFields() { /** * @return The types of associations with other models that the custom object class can have. */ - @JsonProperty("association_types") + @JsonIgnore public Optional>> getAssociationTypes() { + if (associationTypes == null) { + return Optional.empty(); + } + return associationTypes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("association_types") + private Optional>> _getAssociationTypes() { return associationTypes; } @@ -235,6 +274,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + @JsonSetter(value = "created_at", nulls = Nulls.SKIP) public Builder createdAt(Optional createdAt) { this.createdAt = createdAt; @@ -271,6 +321,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The custom object class's description.

          */ @@ -285,6 +346,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The custom object class's singular and plural labels.

          */ @@ -324,6 +396,17 @@ public Builder associationTypes(List> associationTypes) { return this; } + public Builder associationTypes(Nullable>> associationTypes) { + if (associationTypes.isNull()) { + this.associationTypes = null; + } else if (associationTypes.isEmpty()) { + this.associationTypes = Optional.empty(); + } else { + this.associationTypes = Optional.of(associationTypes.get()); + } + return this; + } + public CustomObjectClass build() { return new CustomObjectClass( id, 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..cc13e58d1 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesAssociationTypesListRequest.Builder.class) public final class CustomObjectClassesAssociationTypesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -48,7 +51,7 @@ public final class CustomObjectClassesAssociationTypesListRequest { private final Map additionalProperties; private CustomObjectClassesAssociationTypesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -78,7 +81,7 @@ private CustomObjectClassesAssociationTypesListRequest( * @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; } @@ -157,8 +160,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -215,7 +227,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 createdAfter = Optional.empty(); @@ -261,17 +273,17 @@ public Builder from(CustomObjectClassesAssociationTypesListRequest 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(CustomObjectClassesAssociationTypesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -416,6 +428,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CustomObjectClassesAssociationTypesListRequest build() { return new CustomObjectClassesAssociationTypesListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequestExpandItem.java new file mode 100644 index 000000000..d6dcf9820 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesListRequestExpandItem.java @@ -0,0 +1,77 @@ +/** + * 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 CustomObjectClassesAssociationTypesListRequestExpandItem { + public static final CustomObjectClassesAssociationTypesListRequestExpandItem TARGET_OBJECT_CLASSES = + new CustomObjectClassesAssociationTypesListRequestExpandItem( + Value.TARGET_OBJECT_CLASSES, "target_object_classes"); + + private final Value value; + + private final String string; + + CustomObjectClassesAssociationTypesListRequestExpandItem(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 CustomObjectClassesAssociationTypesListRequestExpandItem + && this.string.equals( + ((CustomObjectClassesAssociationTypesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TARGET_OBJECT_CLASSES: + return visitor.visitTargetObjectClasses(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomObjectClassesAssociationTypesListRequestExpandItem valueOf(String value) { + switch (value) { + case "target_object_classes": + return TARGET_OBJECT_CLASSES; + default: + return new CustomObjectClassesAssociationTypesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + TARGET_OBJECT_CLASSES, + + UNKNOWN + } + + public interface Visitor { + T visitTargetObjectClasses(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.java new file mode 100644 index 000000000..3ae78d92f --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectClassesAssociationTypesMetaPostRetrieveRequest.Builder.class) +public final class CustomObjectClassesAssociationTypesMetaPostRetrieveRequest { + private final Map additionalProperties; + + private CustomObjectClassesAssociationTypesMetaPostRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesAssociationTypesMetaPostRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesAssociationTypesMetaPostRetrieveRequest other) { + return this; + } + + public CustomObjectClassesAssociationTypesMetaPostRetrieveRequest build() { + return new CustomObjectClassesAssociationTypesMetaPostRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java index 21e186f99..543e572f5 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesAssociationTypesRetrieveRequest.Builder.class) public final class CustomObjectClassesAssociationTypesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class CustomObjectClassesAssociationTypesRetrieveRequest { private final Map additionalProperties; private CustomObjectClassesAssociationTypesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private CustomObjectClassesAssociationTypesRetrieveRequest( * @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; } @@ -99,7 +99,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(); @@ -121,17 +121,17 @@ public Builder from(CustomObjectClassesAssociationTypesRetrieveRequest 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(CustomObjectClassesAssociationTypesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..0320b6201 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesAssociationTypesRetrieveRequestExpandItem.java @@ -0,0 +1,77 @@ +/** + * 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 CustomObjectClassesAssociationTypesRetrieveRequestExpandItem { + public static final CustomObjectClassesAssociationTypesRetrieveRequestExpandItem TARGET_OBJECT_CLASSES = + new CustomObjectClassesAssociationTypesRetrieveRequestExpandItem( + Value.TARGET_OBJECT_CLASSES, "target_object_classes"); + + private final Value value; + + private final String string; + + CustomObjectClassesAssociationTypesRetrieveRequestExpandItem(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 CustomObjectClassesAssociationTypesRetrieveRequestExpandItem + && this.string.equals( + ((CustomObjectClassesAssociationTypesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TARGET_OBJECT_CLASSES: + return visitor.visitTargetObjectClasses(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomObjectClassesAssociationTypesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "target_object_classes": + return TARGET_OBJECT_CLASSES; + default: + return new CustomObjectClassesAssociationTypesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + TARGET_OBJECT_CLASSES, + + UNKNOWN + } + + public interface Visitor { + T visitTargetObjectClasses(); + + T visitUnknown(String unknownType); + } +} 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..436032219 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesCustomObjectsAssociationsListRequest.Builder.class) public final class CustomObjectClassesCustomObjectsAssociationsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional associationTypeId; @@ -50,7 +53,7 @@ public final class CustomObjectClassesCustomObjectsAssociationsListRequest { private final Map additionalProperties; private CustomObjectClassesCustomObjectsAssociationsListRequest( - Optional> expand, + Optional> expand, Optional associationTypeId, Optional createdAfter, Optional createdBefore, @@ -82,7 +85,7 @@ private CustomObjectClassesCustomObjectsAssociationsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -229,7 +241,8 @@ public static Builder builder() { @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder { - private Optional> expand = Optional.empty(); + private Optional> expand = + Optional.empty(); private Optional associationTypeId = Optional.empty(); @@ -278,17 +291,18 @@ public Builder from(CustomObjectClassesCustomObjectsAssociationsListRequest othe *

          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(CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -447,6 +461,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CustomObjectClassesCustomObjectsAssociationsListRequest build() { return new CustomObjectClassesCustomObjectsAssociationsListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem.java new file mode 100644 index 000000000..1c29bc47e --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem.java @@ -0,0 +1,77 @@ +/** + * 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 CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem { + public static final CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem ASSOCIATION_TYPE = + new CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem( + Value.ASSOCIATION_TYPE, "association_type"); + + private final Value value; + + private final String string; + + CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem(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 CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem + && this.string.equals( + ((CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ASSOCIATION_TYPE: + return visitor.visitAssociationType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem valueOf(String value) { + switch (value) { + case "association_type": + return ASSOCIATION_TYPE; + default: + return new CustomObjectClassesCustomObjectsAssociationsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ASSOCIATION_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAssociationType(); + + T visitUnknown(String unknownType); + } +} 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..b3a59a05e 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -409,6 +421,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CustomObjectClassesCustomObjectsListRequest build() { return new CustomObjectClassesCustomObjectsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.java new file mode 100644 index 000000000..294bb1794 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CustomObjectClassesCustomObjectsMetaPostRetrieveRequest.Builder.class) +public final class CustomObjectClassesCustomObjectsMetaPostRetrieveRequest { + private final Map additionalProperties; + + private CustomObjectClassesCustomObjectsMetaPostRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CustomObjectClassesCustomObjectsMetaPostRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CustomObjectClassesCustomObjectsMetaPostRetrieveRequest other) { + return this; + } + + public CustomObjectClassesCustomObjectsMetaPostRetrieveRequest build() { + return new CustomObjectClassesCustomObjectsMetaPostRetrieveRequest(additionalProperties); + } + } +} 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..3e8b87275 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesCustomObjectsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ 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..e47c0df47 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesListRequest.Builder.class) public final class CustomObjectClassesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -48,7 +51,7 @@ public final class CustomObjectClassesListRequest { private final Map additionalProperties; private CustomObjectClassesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -78,7 +81,7 @@ private CustomObjectClassesListRequest( * @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; } @@ -157,8 +160,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -214,7 +226,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 createdAfter = Optional.empty(); @@ -260,17 +272,17 @@ public Builder from(CustomObjectClassesListRequest 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(CustomObjectClassesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -415,6 +427,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CustomObjectClassesListRequest build() { return new CustomObjectClassesListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequestExpandItem.java new file mode 100644 index 000000000..abb07569d --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 CustomObjectClassesListRequestExpandItem { + public static final CustomObjectClassesListRequestExpandItem FIELDS = + new CustomObjectClassesListRequestExpandItem(Value.FIELDS, "fields"); + + private final Value value; + + private final String string; + + CustomObjectClassesListRequestExpandItem(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 CustomObjectClassesListRequestExpandItem + && this.string.equals(((CustomObjectClassesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FIELDS: + return visitor.visitFields(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomObjectClassesListRequestExpandItem valueOf(String value) { + switch (value) { + case "fields": + return FIELDS; + default: + return new CustomObjectClassesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + FIELDS, + + UNKNOWN + } + + public interface Visitor { + T visitFields(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java index b93f9105c..1ff4adfb6 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CustomObjectClassesRetrieveRequest.Builder.class) public final class CustomObjectClassesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class CustomObjectClassesRetrieveRequest { private final Map additionalProperties; private CustomObjectClassesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private CustomObjectClassesRetrieveRequest( * @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; } @@ -99,7 +99,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(); @@ -121,17 +121,17 @@ public Builder from(CustomObjectClassesRetrieveRequest 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(CustomObjectClassesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..9c30fd664 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/CustomObjectClassesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 CustomObjectClassesRetrieveRequestExpandItem { + public static final CustomObjectClassesRetrieveRequestExpandItem FIELDS = + new CustomObjectClassesRetrieveRequestExpandItem(Value.FIELDS, "fields"); + + private final Value value; + + private final String string; + + CustomObjectClassesRetrieveRequestExpandItem(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 CustomObjectClassesRetrieveRequestExpandItem + && this.string.equals(((CustomObjectClassesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FIELDS: + return visitor.visitFields(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CustomObjectClassesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "fields": + return FIELDS; + default: + return new CustomObjectClassesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + FIELDS, + + UNKNOWN + } + + public interface Visitor { + T visitFields(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java b/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java index 3d13c8688..5a3509343 100644 --- a/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java +++ b/src/main/java/com/merge/api/crm/types/CustomObjectRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -46,13 +49,31 @@ public Map getFields() { return fields; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -139,6 +160,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -150,6 +182,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CustomObjectRequest build() { return new CustomObjectRequest(fields, integrationParams, linkedAccountParams, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java index 8eb93f6ad..2a2c5218f 100644 --- a/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/crm/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

          The data with the request. You must include a request_format parameter matching the data's format

          */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

          Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

          */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

          */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

          */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. diff --git a/src/main/java/com/merge/api/crm/types/EmailAddress.java b/src/main/java/com/merge/api/crm/types/EmailAddress.java index 6533562dd..785be54cb 100644 --- a/src/main/java/com/merge/api/crm/types/EmailAddress.java +++ b/src/main/java/com/merge/api/crm/types/EmailAddress.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -63,16 +66,34 @@ public Optional getModifiedAt() { /** * @return The email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The email address's type. */ - @JsonProperty("email_address_type") + @JsonIgnore public Optional getEmailAddressType() { + if (emailAddressType == null) { + return Optional.empty(); + } + return emailAddressType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address_type") + private Optional _getEmailAddressType() { return emailAddressType; } @@ -173,6 +194,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

          The email address's type.

          */ @@ -187,6 +219,17 @@ public Builder emailAddressType(String emailAddressType) { return this; } + public Builder emailAddressType(Nullable emailAddressType) { + if (emailAddressType.isNull()) { + this.emailAddressType = null; + } else if (emailAddressType.isEmpty()) { + this.emailAddressType = Optional.empty(); + } else { + this.emailAddressType = Optional.of(emailAddressType.get()); + } + return this; + } + public EmailAddress build() { return new EmailAddress(createdAt, modifiedAt, emailAddress, emailAddressType, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java b/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java index 0d74047c9..b8f5d74dd 100644 --- a/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java +++ b/src/main/java/com/merge/api/crm/types/EmailAddressRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,26 +50,62 @@ private EmailAddressRequest( /** * @return The email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The email address's type. */ - @JsonProperty("email_address_type") + @JsonIgnore public Optional getEmailAddressType() { + if (emailAddressType == null) { + return Optional.empty(); + } return emailAddressType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address_type") + private Optional _getEmailAddressType() { + return emailAddressType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -139,6 +178,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

          The email address's type.

          */ @@ -153,6 +203,17 @@ public Builder emailAddressType(String emailAddressType) { return this; } + public Builder emailAddressType(Nullable emailAddressType) { + if (emailAddressType.isNull()) { + this.emailAddressType = null; + } else if (emailAddressType.isEmpty()) { + this.emailAddressType = Optional.empty(); + } else { + this.emailAddressType = Optional.of(emailAddressType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -164,6 +225,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -175,6 +247,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public EmailAddressRequest build() { return new EmailAddressRequest( emailAddress, emailAddressType, integrationParams, linkedAccountParams, additionalProperties); diff --git a/src/main/java/com/merge/api/crm/types/EncodingEnum.java b/src/main/java/com/merge/api/crm/types/EncodingEnum.java index fe273029a..9403b323a 100644 --- a/src/main/java/com/merge/api/crm/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/crm/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } diff --git a/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java index d9055f594..75fe83f18 100644 --- a/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/crm/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
        • de - de
        • *
        */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

        */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

        */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

        */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

        */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

        The following subset of IETF language tags can be used to configure localization.

        *
          @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

          The boolean that indicates whether initial, periodic, and force syncs will be disabled.

          */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

          A JSON object containing integration-specific configuration options.

          */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

          A JSON object containing integration-specific configuration options.

          * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

          The following subset of IETF language tags can be used to configure localization.

          + *
            + *
          • en - en
          • + *
          • de - de
          • + *
          + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

          The following subset of IETF language tags can be used to configure localization.

          *
            @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/crm/types/Engagement.java b/src/main/java/com/merge/api/crm/types/Engagement.java index e12f5b6ed..7ce56a6d1 100644 --- a/src/main/java/com/merge/api/crm/types/Engagement.java +++ b/src/main/java/com/merge/api/crm/types/Engagement.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,24 +136,33 @@ public Optional getModifiedAt() { /** * @return The engagement's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The engagement's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The engagement's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } @@ -158,40 +173,55 @@ public Optional getSubject() { *
          • OUTBOUND - OUTBOUND
          • *
          */ - @JsonProperty("direction") + @JsonIgnore public Optional getDirection() { + if (direction == null) { + return Optional.empty(); + } return direction; } /** * @return The engagement type of the engagement. */ - @JsonProperty("engagement_type") + @JsonIgnore public Optional getEngagementType() { + if (engagementType == null) { + return Optional.empty(); + } return engagementType; } /** * @return The time at which the engagement started. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The time at which the engagement ended. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } /** * @return The account of the engagement. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } @@ -208,13 +238,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -223,6 +259,72 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("direction") + private Optional _getDirection() { + return direction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("engagement_type") + private Optional _getEngagementType() { + return engagementType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -372,6 +474,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -414,6 +527,17 @@ public Builder owner(EngagementOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The engagement's content.

          */ @@ -428,6 +552,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

          The engagement's subject.

          */ @@ -442,6 +577,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

          The engagement's direction.

          *
            @@ -460,6 +606,17 @@ public Builder direction(EngagementDirection direction) { return this; } + public Builder direction(Nullable direction) { + if (direction.isNull()) { + this.direction = null; + } else if (direction.isEmpty()) { + this.direction = Optional.empty(); + } else { + this.direction = Optional.of(direction.get()); + } + return this; + } + /** *

            The engagement type of the engagement.

            */ @@ -474,6 +631,17 @@ public Builder engagementType(EngagementEngagementType engagementType) { return this; } + public Builder engagementType(Nullable engagementType) { + if (engagementType.isNull()) { + this.engagementType = null; + } else if (engagementType.isEmpty()) { + this.engagementType = Optional.empty(); + } else { + this.engagementType = Optional.of(engagementType.get()); + } + return this; + } + /** *

            The time at which the engagement started.

            */ @@ -488,6 +656,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

            The time at which the engagement ended.

            */ @@ -502,6 +681,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + return this; + } + /** *

            The account of the engagement.

            */ @@ -516,6 +706,17 @@ public Builder account(EngagementAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) public Builder contacts(Optional>> contacts) { this.contacts = contacts; @@ -552,6 +753,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -563,6 +775,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/EngagementRequest.java b/src/main/java/com/merge/api/crm/types/EngagementRequest.java index 31bcd1dea..152db779c 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -81,24 +84,33 @@ private EngagementRequest( /** * @return The engagement's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The engagement's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The engagement's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } @@ -109,40 +121,55 @@ public Optional getSubject() { *
          • OUTBOUND - OUTBOUND
          • *
          */ - @JsonProperty("direction") + @JsonIgnore public Optional getDirection() { + if (direction == null) { + return Optional.empty(); + } return direction; } /** * @return The engagement type of the engagement. */ - @JsonProperty("engagement_type") + @JsonIgnore public Optional getEngagementType() { + if (engagementType == null) { + return Optional.empty(); + } return engagementType; } /** * @return The time at which the engagement started. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The time at which the engagement ended. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } /** * @return The account of the engagement. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } @@ -151,13 +178,19 @@ public Optional>> getContacts() { return contacts; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -166,6 +199,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("direction") + private Optional _getDirection() { + return direction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("engagement_type") + private Optional _getEngagementType() { + return engagementType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -279,6 +372,17 @@ public Builder owner(EngagementRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The engagement's content.

          */ @@ -293,6 +397,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

          The engagement's subject.

          */ @@ -307,6 +422,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

          The engagement's direction.

          *
            @@ -325,6 +451,17 @@ public Builder direction(EngagementRequestDirection direction) { return this; } + public Builder direction(Nullable direction) { + if (direction.isNull()) { + this.direction = null; + } else if (direction.isEmpty()) { + this.direction = Optional.empty(); + } else { + this.direction = Optional.of(direction.get()); + } + return this; + } + /** *

            The engagement type of the engagement.

            */ @@ -339,6 +476,17 @@ public Builder engagementType(EngagementRequestEngagementType engagementType) { return this; } + public Builder engagementType(Nullable engagementType) { + if (engagementType.isNull()) { + this.engagementType = null; + } else if (engagementType.isEmpty()) { + this.engagementType = Optional.empty(); + } else { + this.engagementType = Optional.of(engagementType.get()); + } + return this; + } + /** *

            The time at which the engagement started.

            */ @@ -353,6 +501,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

            The time at which the engagement ended.

            */ @@ -367,6 +526,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + return this; + } + /** *

            The account of the engagement.

            */ @@ -381,6 +551,17 @@ public Builder account(EngagementRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) public Builder contacts(Optional>> contacts) { this.contacts = contacts; @@ -403,6 +584,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -414,6 +606,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/EngagementType.java b/src/main/java/com/merge/api/crm/types/EngagementType.java index 7034741d1..8d98c7b0a 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementType.java +++ b/src/main/java/com/merge/api/crm/types/EngagementType.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -65,8 +68,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -94,16 +100,22 @@ public Optional getModifiedAt() { *
          • EMAIL - EMAIL
          • *
          */ - @JsonProperty("activity_type") + @JsonIgnore public Optional getActivityType() { + if (activityType == null) { + return Optional.empty(); + } return activityType; } /** * @return The engagement type's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -112,6 +124,24 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("activity_type") + private Optional _getActivityType() { + return activityType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -211,6 +241,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -258,6 +299,17 @@ public Builder activityType(EngagementTypeActivityType activityType) { return this; } + public Builder activityType(Nullable activityType) { + if (activityType.isNull()) { + this.activityType = null; + } else if (activityType.isEmpty()) { + this.activityType = Optional.empty(); + } else { + this.activityType = Optional.of(activityType.get()); + } + return this; + } + /** *

          The engagement type's name.

          */ @@ -272,6 +324,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..9fffe0aed 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -408,6 +420,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public EngagementTypesListRequest build() { return new EngagementTypesListRequest( createdAfter, 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..38a01939f 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementTypesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ 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..0d5b67a8b 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -177,24 +180,51 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return engagements started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return engagements started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { return startedBefore; } @@ -480,6 +510,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          If provided, will only return engagements started after this datetime.

          */ @@ -494,6 +535,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

          If provided, will only return engagements started before this datetime.

          */ @@ -508,6 +560,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + public EngagementsListRequest build() { return new EngagementsListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/EngagementsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/EngagementsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..d67851037 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/EngagementsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = EngagementsMetaPatchRetrieveRequest.Builder.class) +public final class EngagementsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private EngagementsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EngagementsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(EngagementsMetaPatchRetrieveRequest other) { + return this; + } + + public EngagementsMetaPatchRetrieveRequest build() { + return new EngagementsMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..48bcc1066 100644 --- a/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/EngagementsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ diff --git a/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java index 1b7617a11..39e59e881 100644 --- a/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/crm/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); } 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..aa85ce760 100644 --- a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java index 5cc3f38cb..770261b5a 100644 --- a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index 3dda3e9dc..06104db25 100644 --- a/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/crm/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/crm/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/crm/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..df37746c9 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/crm/types/Issue.java b/src/main/java/com/merge/api/crm/types/Issue.java index 7c926ff6d..28ad29841 100644 --- a/src/main/java/com/merge/api/crm/types/Issue.java +++ b/src/main/java/com/merge/api/crm/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..6b3cc5780 100644 --- a/src/main/java/com/merge/api/crm/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

          If provided, will only return issues whose first incident time was before this datetime.

          */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

          If true, will include muted issues

          */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

          If provided, will only return issues whose last incident time was before this datetime.

          */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

          If provided, will only include issues pertaining to the linked account passed in.

          */ diff --git a/src/main/java/com/merge/api/crm/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..18d67e0a6 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} 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..7e4d44793 100644 --- a/src/main/java/com/merge/api/crm/types/Lead.java +++ b/src/main/java/com/merge/api/crm/types/Lead.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -126,8 +129,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -150,48 +156,66 @@ public Optional getModifiedAt() { /** * @return The lead's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The lead's source. */ - @JsonProperty("lead_source") + @JsonIgnore public Optional getLeadSource() { + if (leadSource == null) { + return Optional.empty(); + } return leadSource; } /** * @return The lead's title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } /** * @return The lead's company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The lead's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The lead's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } @@ -213,40 +237,55 @@ public Optional> getPhoneNumbers() { /** * @return When the third party's lead was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the third party's lead was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the lead was converted. */ - @JsonProperty("converted_date") + @JsonIgnore public Optional getConvertedDate() { + if (convertedDate == null) { + return Optional.empty(); + } return convertedDate; } /** * @return The contact of the converted lead. */ - @JsonProperty("converted_contact") + @JsonIgnore public Optional getConvertedContact() { + if (convertedContact == null) { + return Optional.empty(); + } return convertedContact; } /** * @return The account of the converted lead. */ - @JsonProperty("converted_account") + @JsonIgnore public Optional getConvertedAccount() { + if (convertedAccount == null) { + return Optional.empty(); + } return convertedAccount; } @@ -258,13 +297,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -273,6 +318,90 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("lead_source") + private Optional _getLeadSource() { + return leadSource; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_date") + private Optional _getConvertedDate() { + return convertedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_contact") + private Optional _getConvertedContact() { + return convertedContact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_account") + private Optional _getConvertedAccount() { + return convertedAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -447,6 +576,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -489,6 +629,17 @@ public Builder owner(LeadOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The lead's source.

          */ @@ -503,6 +654,17 @@ public Builder leadSource(String leadSource) { return this; } + public Builder leadSource(Nullable leadSource) { + if (leadSource.isNull()) { + this.leadSource = null; + } else if (leadSource.isEmpty()) { + this.leadSource = Optional.empty(); + } else { + this.leadSource = Optional.of(leadSource.get()); + } + return this; + } + /** *

          The lead's title.

          */ @@ -517,6 +679,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

          The lead's company.

          */ @@ -531,6 +704,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The lead's first name.

          */ @@ -545,6 +729,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The lead's last name.

          */ @@ -559,6 +754,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -606,6 +812,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

          When the third party's lead was created.

          */ @@ -620,6 +837,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

          When the lead was converted.

          */ @@ -634,6 +862,17 @@ public Builder convertedDate(OffsetDateTime convertedDate) { return this; } + public Builder convertedDate(Nullable convertedDate) { + if (convertedDate.isNull()) { + this.convertedDate = null; + } else if (convertedDate.isEmpty()) { + this.convertedDate = Optional.empty(); + } else { + this.convertedDate = Optional.of(convertedDate.get()); + } + return this; + } + /** *

          The contact of the converted lead.

          */ @@ -648,6 +887,17 @@ public Builder convertedContact(LeadConvertedContact convertedContact) { return this; } + public Builder convertedContact(Nullable convertedContact) { + if (convertedContact.isNull()) { + this.convertedContact = null; + } else if (convertedContact.isEmpty()) { + this.convertedContact = Optional.empty(); + } else { + this.convertedContact = Optional.of(convertedContact.get()); + } + return this; + } + /** *

          The account of the converted lead.

          */ @@ -662,6 +912,17 @@ public Builder convertedAccount(LeadConvertedAccount convertedAccount) { return this; } + public Builder convertedAccount(Nullable convertedAccount) { + if (convertedAccount.isNull()) { + this.convertedAccount = null; + } else if (convertedAccount.isEmpty()) { + this.convertedAccount = Optional.empty(); + } else { + this.convertedAccount = Optional.of(convertedAccount.get()); + } + 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.

          */ @@ -687,6 +948,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -698,6 +970,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/LeadRequest.java b/src/main/java/com/merge/api/crm/types/LeadRequest.java index f2314c6af..62e789d25 100644 --- a/src/main/java/com/merge/api/crm/types/LeadRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -93,48 +96,66 @@ private LeadRequest( /** * @return The lead's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The lead's source. */ - @JsonProperty("lead_source") + @JsonIgnore public Optional getLeadSource() { + if (leadSource == null) { + return Optional.empty(); + } return leadSource; } /** * @return The lead's title. */ - @JsonProperty("title") + @JsonIgnore public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } return title; } /** * @return The lead's company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The lead's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The lead's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } @@ -156,34 +177,49 @@ public Optional> getPhoneNumbers() { /** * @return When the lead was converted. */ - @JsonProperty("converted_date") + @JsonIgnore public Optional getConvertedDate() { + if (convertedDate == null) { + return Optional.empty(); + } return convertedDate; } /** * @return The contact of the converted lead. */ - @JsonProperty("converted_contact") + @JsonIgnore public Optional getConvertedContact() { + if (convertedContact == null) { + return Optional.empty(); + } return convertedContact; } /** * @return The account of the converted lead. */ - @JsonProperty("converted_account") + @JsonIgnore public Optional getConvertedAccount() { + if (convertedAccount == null) { + return Optional.empty(); + } return convertedAccount; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -192,6 +228,72 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("lead_source") + private Optional _getLeadSource() { + return leadSource; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_date") + private Optional _getConvertedDate() { + return convertedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_contact") + private Optional _getConvertedContact() { + return convertedContact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("converted_account") + private Optional _getConvertedAccount() { + return convertedAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -320,6 +422,17 @@ public Builder owner(LeadRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

          The lead's source.

          */ @@ -334,6 +447,17 @@ public Builder leadSource(String leadSource) { return this; } + public Builder leadSource(Nullable leadSource) { + if (leadSource.isNull()) { + this.leadSource = null; + } else if (leadSource.isEmpty()) { + this.leadSource = Optional.empty(); + } else { + this.leadSource = Optional.of(leadSource.get()); + } + return this; + } + /** *

          The lead's title.

          */ @@ -348,6 +472,17 @@ public Builder title(String title) { return this; } + public Builder title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + /** *

          The lead's company.

          */ @@ -362,6 +497,17 @@ public Builder company(String company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

          The lead's first name.

          */ @@ -376,6 +522,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

          The lead's last name.

          */ @@ -390,6 +547,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -437,6 +605,17 @@ public Builder convertedDate(OffsetDateTime convertedDate) { return this; } + public Builder convertedDate(Nullable convertedDate) { + if (convertedDate.isNull()) { + this.convertedDate = null; + } else if (convertedDate.isEmpty()) { + this.convertedDate = Optional.empty(); + } else { + this.convertedDate = Optional.of(convertedDate.get()); + } + return this; + } + /** *

          The contact of the converted lead.

          */ @@ -451,6 +630,17 @@ public Builder convertedContact(LeadRequestConvertedContact convertedContact) { return this; } + public Builder convertedContact(Nullable convertedContact) { + if (convertedContact.isNull()) { + this.convertedContact = null; + } else if (convertedContact.isEmpty()) { + this.convertedContact = Optional.empty(); + } else { + this.convertedContact = Optional.of(convertedContact.get()); + } + return this; + } + /** *

          The account of the converted lead.

          */ @@ -465,6 +655,17 @@ public Builder convertedAccount(LeadRequestConvertedAccount convertedAccount) { return this; } + public Builder convertedAccount(Nullable convertedAccount) { + if (convertedAccount.isNull()) { + this.convertedAccount = null; + } else if (convertedAccount.isEmpty()) { + this.convertedAccount = Optional.empty(); + } else { + this.convertedAccount = Optional.of(convertedAccount.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -476,6 +677,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -487,6 +699,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..540e58434 100644 --- a/src/main/java/com/merge/api/crm/types/LeadsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -229,8 +232,17 @@ public Optional getPhoneNumbers() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -601,6 +613,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public LeadsListRequest build() { return new LeadsListRequest( expand, 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..aeb80f417 100644 --- a/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LeadsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

          */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

          Number of results to return per page.

          */ 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..45719abed 100644 --- a/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/crm/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
        • filestorage - filestorage
        • *
        */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

        The pagination cursor value.

        */ diff --git a/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java index 9ae0c1056..50be030c6 100644 --- a/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/crm/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -72,24 +75,51 @@ public String getData() { *
      • GZIP_BASE64 - GZIP_BASE64
      • *
      */ - @JsonProperty("encoding") + @JsonIgnore public Optional getEncoding() { + if (encoding == null) { + return Optional.empty(); + } return encoding; } /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encoding") + private Optional _getEncoding() { + return encoding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -157,6 +187,8 @@ public interface _FinalStage { _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + _FinalStage encoding(Nullable encoding); + /** *

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

      */ @@ -164,12 +196,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

      The MIME type of the file, if the field is for a file.

      */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +259,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +295,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. @@ -263,6 +331,27 @@ public _FinalStage fileName(Optional fileName) { return this; } + /** + *

      The encoding of the value of data. Defaults to RAW if not defined.

      + *
        + *
      • RAW - RAW
      • + *
      • BASE64 - BASE64
      • + *
      • GZIP_BASE64 - GZIP_BASE64
      • + *
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(Nullable encoding) { + if (encoding.isNull()) { + this.encoding = null; + } else if (encoding.isEmpty()) { + this.encoding = Optional.empty(); + } else { + this.encoding = Optional.of(encoding.get()); + } + return this; + } + /** *

      The encoding of the value of data. Defaults to RAW if not defined.

      *
        diff --git a/src/main/java/com/merge/api/crm/types/Note.java b/src/main/java/com/merge/api/crm/types/Note.java index 409c147a5..34bd68538 100644 --- a/src/main/java/com/merge/api/crm/types/Note.java +++ b/src/main/java/com/merge/api/crm/types/Note.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -98,8 +101,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -122,56 +128,77 @@ public Optional getModifiedAt() { /** * @return The note's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The note's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The note's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The note's opportunity. */ - @JsonProperty("opportunity") + @JsonIgnore public Optional getOpportunity() { + if (opportunity == null) { + return Optional.empty(); + } return opportunity; } /** * @return When the third party's lead was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the third party's lead was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -183,13 +210,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -198,6 +231,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("opportunity") + private Optional _getOpportunity() { + return opportunity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -337,6 +430,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -379,6 +483,17 @@ public Builder owner(NoteOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

        The note's content.

        */ @@ -393,6 +508,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

        The note's contact.

        */ @@ -407,6 +533,17 @@ public Builder contact(NoteContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The note's account.

        */ @@ -421,6 +558,17 @@ public Builder account(NoteAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The note's opportunity.

        */ @@ -435,6 +583,17 @@ public Builder opportunity(NoteOpportunity opportunity) { return this; } + public Builder opportunity(Nullable opportunity) { + if (opportunity.isNull()) { + this.opportunity = null; + } else if (opportunity.isEmpty()) { + this.opportunity = Optional.empty(); + } else { + this.opportunity = Optional.of(opportunity.get()); + } + return this; + } + /** *

        When the third party's lead was updated.

        */ @@ -449,6 +608,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

        When the third party's lead was created.

        */ @@ -463,6 +633,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

        */ @@ -488,6 +669,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -499,6 +691,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/NoteRequest.java b/src/main/java/com/merge/api/crm/types/NoteRequest.java index 9e76d513a..37151c7ef 100644 --- a/src/main/java/com/merge/api/crm/types/NoteRequest.java +++ b/src/main/java/com/merge/api/crm/types/NoteRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -64,50 +67,71 @@ private NoteRequest( /** * @return The note's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The note's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The note's contact. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The note's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The note's opportunity. */ - @JsonProperty("opportunity") + @JsonIgnore public Optional getOpportunity() { + if (opportunity == null) { + return Optional.empty(); + } return opportunity; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -116,6 +140,48 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("opportunity") + private Optional _getOpportunity() { + return opportunity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -209,6 +275,17 @@ public Builder owner(NoteRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

        The note's content.

        */ @@ -223,6 +300,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

        The note's contact.

        */ @@ -237,6 +325,17 @@ public Builder contact(NoteRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The note's account.

        */ @@ -251,6 +350,17 @@ public Builder account(NoteRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The note's opportunity.

        */ @@ -265,6 +375,17 @@ public Builder opportunity(NoteRequestOpportunity opportunity) { return this; } + public Builder opportunity(Nullable opportunity) { + if (opportunity.isNull()) { + this.opportunity = null; + } else if (opportunity.isEmpty()) { + this.opportunity = Optional.empty(); + } else { + this.opportunity = Optional.of(opportunity.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -276,6 +397,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -287,6 +419,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..6f35ac500 100644 --- a/src/main/java/com/merge/api/crm/types/NotesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -217,8 +220,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -570,6 +582,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public NotesListRequest build() { return new NotesListRequest( expand, 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..0f9588aa2 100644 --- a/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/NotesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ 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..fadd4ff91 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -51,11 +54,11 @@ public final class OpportunitiesListRequest { private final Optional remoteCreatedAfter; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional stageId; @@ -78,9 +81,9 @@ private OpportunitiesListRequest( Optional ownerId, Optional pageSize, Optional remoteCreatedAfter, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional stageId, Optional status, Map additionalProperties) { @@ -213,8 +216,11 @@ public Optional getPageSize() { /** * @return If provided, will only return opportunities created in the third party platform after this datetime. */ - @JsonProperty("remote_created_after") + @JsonIgnore public Optional getRemoteCreatedAfter() { + if (remoteCreatedAfter == null) { + return Optional.empty(); + } return remoteCreatedAfter; } @@ -222,15 +228,18 @@ public Optional getRemoteCreatedAfter() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -238,7 +247,7 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -258,8 +267,29 @@ public Optional getStageId() { *
      • LOST - LOST
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_after") + private Optional _getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -359,11 +389,11 @@ public static final class Builder { private Optional remoteCreatedAfter = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional stageId = Optional.empty(); @@ -598,16 +628,27 @@ public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { return this; } + public Builder remoteCreatedAfter(Nullable remoteCreatedAfter) { + if (remoteCreatedAfter.isNull()) { + this.remoteCreatedAfter = null; + } else if (remoteCreatedAfter.isEmpty()) { + this.remoteCreatedAfter = Optional.empty(); + } else { + this.remoteCreatedAfter = Optional.of(remoteCreatedAfter.get()); + } + return this; + } + /** *

      Deprecated. Use show_enum_origins.

      */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(OpportunitiesListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -626,16 +667,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(OpportunitiesListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } @@ -673,6 +725,17 @@ public Builder status(OpportunitiesListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public OpportunitiesListRequest build() { return new OpportunitiesListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestRemoteFields.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestRemoteFields.java new file mode 100644 index 000000000..7797ccebb --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 OpportunitiesListRequestRemoteFields { + public static final OpportunitiesListRequestRemoteFields STATUS = + new OpportunitiesListRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OpportunitiesListRequestRemoteFields(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 OpportunitiesListRequestRemoteFields + && this.string.equals(((OpportunitiesListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OpportunitiesListRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OpportunitiesListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..caeb92bce --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 OpportunitiesListRequestShowEnumOrigins { + public static final OpportunitiesListRequestShowEnumOrigins STATUS = + new OpportunitiesListRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OpportunitiesListRequestShowEnumOrigins(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 OpportunitiesListRequestShowEnumOrigins + && this.string.equals(((OpportunitiesListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OpportunitiesListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OpportunitiesListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..6b84614f0 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = OpportunitiesMetaPatchRetrieveRequest.Builder.class) +public final class OpportunitiesMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private OpportunitiesMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OpportunitiesMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(OpportunitiesMetaPatchRetrieveRequest other) { + return this; + } + + public OpportunitiesMetaPatchRetrieveRequest build() { + return new OpportunitiesMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..ab5bf82e8 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java index 1f2e48c82..682940dd6 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequest.java @@ -30,9 +30,9 @@ public final class OpportunitiesRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; @@ -41,8 +41,8 @@ private OpportunitiesRetrieveRequest( Optional includeRemoteData, Optional includeRemoteFields, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -89,7 +89,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -97,7 +97,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -151,9 +151,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -235,12 +235,12 @@ public Builder includeShellData(Boolean includeShellData) { *

      Deprecated. Use show_enum_origins.

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

      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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(OpportunitiesRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..b4bb16013 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 OpportunitiesRetrieveRequestRemoteFields { + public static final OpportunitiesRetrieveRequestRemoteFields STATUS = + new OpportunitiesRetrieveRequestRemoteFields(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OpportunitiesRetrieveRequestRemoteFields(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 OpportunitiesRetrieveRequestRemoteFields + && this.string.equals(((OpportunitiesRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OpportunitiesRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OpportunitiesRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..a52b2908c --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/OpportunitiesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 OpportunitiesRetrieveRequestShowEnumOrigins { + public static final OpportunitiesRetrieveRequestShowEnumOrigins STATUS = + new OpportunitiesRetrieveRequestShowEnumOrigins(Value.STATUS, "status"); + + private final Value value; + + private final String string; + + OpportunitiesRetrieveRequestShowEnumOrigins(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 OpportunitiesRetrieveRequestShowEnumOrigins + && this.string.equals(((OpportunitiesRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case STATUS: + return visitor.visitStatus(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static OpportunitiesRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "status": + return STATUS; + default: + return new OpportunitiesRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + STATUS, + + UNKNOWN + } + + public interface Visitor { + T visitStatus(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/crm/types/Opportunity.java b/src/main/java/com/merge/api/crm/types/Opportunity.java index f8bd54fb5..e70193954 100644 --- a/src/main/java/com/merge/api/crm/types/Opportunity.java +++ b/src/main/java/com/merge/api/crm/types/Opportunity.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -110,8 +113,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,48 +140,66 @@ public Optional getModifiedAt() { /** * @return The opportunity's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The opportunity's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The opportunity's amount. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return The opportunity's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account of the opportunity. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The stage of the opportunity. */ - @JsonProperty("stage") + @JsonIgnore public Optional getStage() { + if (stage == null) { + return Optional.empty(); + } return stage; } @@ -187,32 +211,44 @@ public Optional getStage() { *
    • LOST - LOST
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return When the opportunity's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } /** * @return When the opportunity was closed. */ - @JsonProperty("close_date") + @JsonIgnore public Optional getCloseDate() { + if (closeDate == null) { + return Optional.empty(); + } return closeDate; } /** * @return When the third party's opportunity was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -224,13 +260,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -239,6 +281,84 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stage") + private Optional _getStage() { + return stage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("close_date") + private Optional _getCloseDate() { + return closeDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -393,6 +513,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -435,6 +566,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The opportunity's description.

    */ @@ -449,6 +591,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The opportunity's amount.

    */ @@ -463,6 +616,17 @@ public Builder amount(Integer amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

    The opportunity's owner.

    */ @@ -477,6 +641,17 @@ public Builder owner(OpportunityOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The account of the opportunity.

    */ @@ -491,6 +666,17 @@ public Builder account(OpportunityAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The stage of the opportunity.

    */ @@ -505,6 +691,17 @@ public Builder stage(OpportunityStage stage) { return this; } + public Builder stage(Nullable stage) { + if (stage.isNull()) { + this.stage = null; + } else if (stage.isEmpty()) { + this.stage = Optional.empty(); + } else { + this.stage = Optional.of(stage.get()); + } + return this; + } + /** *

    The opportunity's status.

    *
      @@ -524,6 +721,17 @@ public Builder status(OpportunityStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      When the opportunity's last activity occurred.

      */ @@ -538,6 +746,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + /** *

      When the opportunity was closed.

      */ @@ -552,6 +771,17 @@ public Builder closeDate(OffsetDateTime closeDate) { return this; } + public Builder closeDate(Nullable closeDate) { + if (closeDate.isNull()) { + this.closeDate = null; + } else if (closeDate.isEmpty()) { + this.closeDate = Optional.empty(); + } else { + this.closeDate = Optional.of(closeDate.get()); + } + return this; + } + /** *

      When the third party's opportunity was created.

      */ @@ -566,6 +796,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

      */ @@ -591,6 +832,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -602,6 +854,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/OpportunityRequest.java b/src/main/java/com/merge/api/crm/types/OpportunityRequest.java index f3389eb64..0ac70d709 100644 --- a/src/main/java/com/merge/api/crm/types/OpportunityRequest.java +++ b/src/main/java/com/merge/api/crm/types/OpportunityRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -81,48 +84,66 @@ private OpportunityRequest( /** * @return The opportunity's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The opportunity's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The opportunity's amount. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return The opportunity's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account of the opportunity. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The stage of the opportunity. */ - @JsonProperty("stage") + @JsonIgnore public Optional getStage() { + if (stage == null) { + return Optional.empty(); + } return stage; } @@ -134,34 +155,49 @@ public Optional getStage() { *
    • LOST - LOST
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return When the opportunity's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } /** * @return When the opportunity was closed. */ - @JsonProperty("close_date") + @JsonIgnore public Optional getCloseDate() { + if (closeDate == null) { + return Optional.empty(); + } return closeDate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -170,6 +206,72 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stage") + private Optional _getStage() { + return stage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("close_date") + private Optional _getCloseDate() { + return closeDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -283,6 +385,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The opportunity's description.

    */ @@ -297,6 +410,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The opportunity's amount.

    */ @@ -311,6 +435,17 @@ public Builder amount(Integer amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

    The opportunity's owner.

    */ @@ -325,6 +460,17 @@ public Builder owner(OpportunityRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The account of the opportunity.

    */ @@ -339,6 +485,17 @@ public Builder account(OpportunityRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The stage of the opportunity.

    */ @@ -353,6 +510,17 @@ public Builder stage(OpportunityRequestStage stage) { return this; } + public Builder stage(Nullable stage) { + if (stage.isNull()) { + this.stage = null; + } else if (stage.isEmpty()) { + this.stage = Optional.empty(); + } else { + this.stage = Optional.of(stage.get()); + } + return this; + } + /** *

    The opportunity's status.

    *
      @@ -372,6 +540,17 @@ public Builder status(OpportunityRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      When the opportunity's last activity occurred.

      */ @@ -386,6 +565,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + /** *

      When the opportunity was closed.

      */ @@ -400,6 +590,17 @@ public Builder closeDate(OffsetDateTime closeDate) { return this; } + public Builder closeDate(Nullable closeDate) { + if (closeDate.isNull()) { + this.closeDate = null; + } else if (closeDate.isEmpty()) { + this.closeDate = Optional.empty(); + } else { + this.closeDate = Optional.of(closeDate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -411,6 +612,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -422,6 +634,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java index d45820818..1477dd200 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java b/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java index df573b743..ac31506f3 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAccountList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java b/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java index aea131957..855806705 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAssociationList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAssociationList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java b/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java index 9554ec02a..d07e90cc4 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAssociationTypeList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAssociationTypeList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java index 9c9fa22dd..35f5d2aee 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedContactList.java b/src/main/java/com/merge/api/crm/types/PaginatedContactList.java index e41185da4..289aaa7ee 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedContactList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedContactList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedContactList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java index 11afe1471..6578b2653 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectClassList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCustomObjectClassList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java index c84858b26..35e8446c5 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedCustomObjectList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCustomObjectList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java b/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java index 42c562d25..bcdc34894 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedEngagementList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEngagementList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java b/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java index f63709fdf..92978abf2 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedEngagementTypeList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEngagementTypeList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java b/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java index 8e2e2d79b..ff255326e 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java b/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java index a720bfcaa..18b23c016 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedLeadList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedLeadList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java b/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java index c64f057eb..5b810c362 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedNoteList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedNoteList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java b/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java index 4f578b36a..fcc0cdcc6 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedOpportunityList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedOpportunityList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java index d29407fac..245be062b 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedRemoteFieldClassList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRemoteFieldClassList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedStageList.java b/src/main/java/com/merge/api/crm/types/PaginatedStageList.java index f18790e08..ec6b3e68c 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedStageList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedStageList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedStageList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java index 426fe835e..6f275214e 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java b/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java index fea8769e2..882014eb3 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedTaskList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTaskList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PaginatedUserList.java b/src/main/java/com/merge/api/crm/types/PaginatedUserList.java index e887e4a2e..8454a89fd 100644 --- a/src/main/java/com/merge/api/crm/types/PaginatedUserList.java +++ b/src/main/java/com/merge/api/crm/types/PaginatedUserList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedUserList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java b/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java index fb3bdbbe7..9193726e0 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedAccountRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,48 +80,66 @@ private PatchedAccountRequest( /** * @return The account's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The account's industry. */ - @JsonProperty("industry") + @JsonIgnore public Optional getIndustry() { + if (industry == null) { + return Optional.empty(); + } return industry; } /** * @return The account's website. */ - @JsonProperty("website") + @JsonIgnore public Optional getWebsite() { + if (website == null) { + return Optional.empty(); + } return website; } /** * @return The account's number of employees. */ - @JsonProperty("number_of_employees") + @JsonIgnore public Optional getNumberOfEmployees() { + if (numberOfEmployees == null) { + return Optional.empty(); + } return numberOfEmployees; } @@ -130,18 +151,27 @@ public Optional> getAddresses() { /** * @return The last date (either most recent or furthest in the future) of when an activity occurs in an account. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -150,6 +180,60 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("industry") + private Optional _getIndustry() { + return industry; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("website") + private Optional _getWebsite() { + return website; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number_of_employees") + private Optional _getNumberOfEmployees() { + return numberOfEmployees; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -258,6 +342,17 @@ public Builder owner(String owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

      The account's name.

      */ @@ -272,6 +367,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      The account's description.

      */ @@ -286,6 +392,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

      The account's industry.

      */ @@ -300,6 +417,17 @@ public Builder industry(String industry) { return this; } + public Builder industry(Nullable industry) { + if (industry.isNull()) { + this.industry = null; + } else if (industry.isEmpty()) { + this.industry = Optional.empty(); + } else { + this.industry = Optional.of(industry.get()); + } + return this; + } + /** *

      The account's website.

      */ @@ -314,6 +442,17 @@ public Builder website(String website) { return this; } + public Builder website(Nullable website) { + if (website.isNull()) { + this.website = null; + } else if (website.isEmpty()) { + this.website = Optional.empty(); + } else { + this.website = Optional.of(website.get()); + } + return this; + } + /** *

      The account's number of employees.

      */ @@ -328,6 +467,17 @@ public Builder numberOfEmployees(Integer numberOfEmployees) { return this; } + public Builder numberOfEmployees(Nullable numberOfEmployees) { + if (numberOfEmployees.isNull()) { + this.numberOfEmployees = null; + } else if (numberOfEmployees.isEmpty()) { + this.numberOfEmployees = Optional.empty(); + } else { + this.numberOfEmployees = Optional.of(numberOfEmployees.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -353,6 +503,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -364,6 +525,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -375,6 +547,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java b/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java index c2022412d..63767bade 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedContactRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,32 +80,44 @@ private PatchedContactRequest( /** * @return The contact's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The contact's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The contact's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } @@ -124,18 +139,27 @@ public Optional> getPhoneNumbers() { /** * @return When the contact's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -144,6 +168,48 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -252,6 +318,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

      The contact's last name.

      */ @@ -266,6 +343,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

      The contact's account.

      */ @@ -280,6 +368,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

      The contact's owner.

      */ @@ -294,6 +393,17 @@ public Builder owner(PatchedContactRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + @JsonSetter(value = "addresses", nulls = Nulls.SKIP) public Builder addresses(Optional> addresses) { this.addresses = addresses; @@ -341,6 +451,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -352,6 +473,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -363,6 +495,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java b/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java index 880bb6a22..20f46d902 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedEngagementRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -81,24 +84,33 @@ private PatchedEngagementRequest( /** * @return The engagement's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The engagement's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The engagement's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } @@ -109,40 +121,55 @@ public Optional getSubject() { *
    • OUTBOUND - OUTBOUND
    • *
    */ - @JsonProperty("direction") + @JsonIgnore public Optional getDirection() { + if (direction == null) { + return Optional.empty(); + } return direction; } /** * @return The engagement type of the engagement. */ - @JsonProperty("engagement_type") + @JsonIgnore public Optional getEngagementType() { + if (engagementType == null) { + return Optional.empty(); + } return engagementType; } /** * @return The time at which the engagement started. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The time at which the engagement ended. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } /** * @return The account of the engagement. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } @@ -151,13 +178,19 @@ public Optional>> getContacts() { return contacts; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -166,6 +199,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("direction") + private Optional _getDirection() { + return direction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("engagement_type") + private Optional _getEngagementType() { + return engagementType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -279,6 +372,17 @@ public Builder owner(String owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The engagement's content.

    */ @@ -293,6 +397,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

    The engagement's subject.

    */ @@ -307,6 +422,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

    The engagement's direction.

    *
      @@ -325,6 +451,17 @@ public Builder direction(PatchedEngagementRequestDirection direction) { return this; } + public Builder direction(Nullable direction) { + if (direction.isNull()) { + this.direction = null; + } else if (direction.isEmpty()) { + this.direction = Optional.empty(); + } else { + this.direction = Optional.of(direction.get()); + } + return this; + } + /** *

      The engagement type of the engagement.

      */ @@ -339,6 +476,17 @@ public Builder engagementType(String engagementType) { return this; } + public Builder engagementType(Nullable engagementType) { + if (engagementType.isNull()) { + this.engagementType = null; + } else if (engagementType.isEmpty()) { + this.engagementType = Optional.empty(); + } else { + this.engagementType = Optional.of(engagementType.get()); + } + return this; + } + /** *

      The time at which the engagement started.

      */ @@ -353,6 +501,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

      The time at which the engagement ended.

      */ @@ -367,6 +526,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + return this; + } + /** *

      The account of the engagement.

      */ @@ -381,6 +551,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + @JsonSetter(value = "contacts", nulls = Nulls.SKIP) public Builder contacts(Optional>> contacts) { this.contacts = contacts; @@ -403,6 +584,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -414,6 +606,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java b/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java index 58a9c890b..332c87262 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedOpportunityRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -81,48 +84,66 @@ private PatchedOpportunityRequest( /** * @return The opportunity's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The opportunity's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The opportunity's amount. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return The opportunity's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The account of the opportunity. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The stage of the opportunity. */ - @JsonProperty("stage") + @JsonIgnore public Optional getStage() { + if (stage == null) { + return Optional.empty(); + } return stage; } @@ -134,34 +155,49 @@ public Optional getStage() { *
    • LOST - LOST
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return When the opportunity's last activity occurred. */ - @JsonProperty("last_activity_at") + @JsonIgnore public Optional getLastActivityAt() { + if (lastActivityAt == null) { + return Optional.empty(); + } return lastActivityAt; } /** * @return When the opportunity was closed. */ - @JsonProperty("close_date") + @JsonIgnore public Optional getCloseDate() { + if (closeDate == null) { + return Optional.empty(); + } return closeDate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -170,6 +206,72 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("stage") + private Optional _getStage() { + return stage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_activity_at") + private Optional _getLastActivityAt() { + return lastActivityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("close_date") + private Optional _getCloseDate() { + return closeDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -283,6 +385,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The opportunity's description.

    */ @@ -297,6 +410,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

    The opportunity's amount.

    */ @@ -311,6 +435,17 @@ public Builder amount(Integer amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

    The opportunity's owner.

    */ @@ -325,6 +460,17 @@ public Builder owner(String owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The account of the opportunity.

    */ @@ -339,6 +485,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The stage of the opportunity.

    */ @@ -353,6 +510,17 @@ public Builder stage(String stage) { return this; } + public Builder stage(Nullable stage) { + if (stage.isNull()) { + this.stage = null; + } else if (stage.isEmpty()) { + this.stage = Optional.empty(); + } else { + this.stage = Optional.of(stage.get()); + } + return this; + } + /** *

    The opportunity's status.

    *
      @@ -372,6 +540,17 @@ public Builder status(PatchedOpportunityRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      When the opportunity's last activity occurred.

      */ @@ -386,6 +565,17 @@ public Builder lastActivityAt(OffsetDateTime lastActivityAt) { return this; } + public Builder lastActivityAt(Nullable lastActivityAt) { + if (lastActivityAt.isNull()) { + this.lastActivityAt = null; + } else if (lastActivityAt.isEmpty()) { + this.lastActivityAt = Optional.empty(); + } else { + this.lastActivityAt = Optional.of(lastActivityAt.get()); + } + return this; + } + /** *

      When the opportunity was closed.

      */ @@ -400,6 +590,17 @@ public Builder closeDate(OffsetDateTime closeDate) { return this; } + public Builder closeDate(Nullable closeDate) { + if (closeDate.isNull()) { + this.closeDate = null; + } else if (closeDate.isEmpty()) { + this.closeDate = Optional.empty(); + } else { + this.closeDate = Optional.of(closeDate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -411,6 +612,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -422,6 +634,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..4c84c0def 100644 --- a/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/PatchedTaskRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,56 +80,77 @@ private PatchedTaskRequest( /** * @return The task's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } /** * @return The task's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The task's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The task's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The task's opportunity. */ - @JsonProperty("opportunity") + @JsonIgnore public Optional getOpportunity() { + if (opportunity == null) { + return Optional.empty(); + } return opportunity; } /** * @return When the task is completed. */ - @JsonProperty("completed_date") + @JsonIgnore public Optional getCompletedDate() { + if (completedDate == null) { + return Optional.empty(); + } return completedDate; } /** * @return When the task is due. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -137,18 +161,27 @@ public Optional getDueDate() { *
    • CLOSED - CLOSED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -157,6 +190,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("opportunity") + private Optional _getOpportunity() { + return opportunity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_date") + private Optional _getCompletedDate() { + return completedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +358,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

    The task's content.

    */ @@ -279,6 +383,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

    The task's owner.

    */ @@ -293,6 +408,17 @@ public Builder owner(String owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The task's account.

    */ @@ -307,6 +433,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The task's opportunity.

    */ @@ -321,6 +458,17 @@ public Builder opportunity(String opportunity) { return this; } + public Builder opportunity(Nullable opportunity) { + if (opportunity.isNull()) { + this.opportunity = null; + } else if (opportunity.isEmpty()) { + this.opportunity = Optional.empty(); + } else { + this.opportunity = Optional.of(opportunity.get()); + } + return this; + } + /** *

    When the task is completed.

    */ @@ -335,6 +483,17 @@ public Builder completedDate(OffsetDateTime completedDate) { return this; } + public Builder completedDate(Nullable completedDate) { + if (completedDate.isNull()) { + this.completedDate = null; + } else if (completedDate.isEmpty()) { + this.completedDate = Optional.empty(); + } else { + this.completedDate = Optional.of(completedDate.get()); + } + return this; + } + /** *

    When the task is due.

    */ @@ -349,6 +508,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

    The task's status.

    *
      @@ -367,6 +537,17 @@ public Builder status(PatchedTaskRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -378,6 +559,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -389,6 +581,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/PhoneNumber.java b/src/main/java/com/merge/api/crm/types/PhoneNumber.java index 6a8a18848..1aae24712 100644 --- a/src/main/java/com/merge/api/crm/types/PhoneNumber.java +++ b/src/main/java/com/merge/api/crm/types/PhoneNumber.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -63,16 +66,34 @@ public Optional getModifiedAt() { /** * @return The phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return The phone number's type. */ - @JsonProperty("phone_number_type") + @JsonIgnore public Optional getPhoneNumberType() { + if (phoneNumberType == null) { + return Optional.empty(); + } + return phoneNumberType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number_type") + private Optional _getPhoneNumberType() { return phoneNumberType; } @@ -173,6 +194,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

      The phone number's type.

      */ @@ -187,6 +219,17 @@ public Builder phoneNumberType(String phoneNumberType) { return this; } + public Builder phoneNumberType(Nullable phoneNumberType) { + if (phoneNumberType.isNull()) { + this.phoneNumberType = null; + } else if (phoneNumberType.isEmpty()) { + this.phoneNumberType = Optional.empty(); + } else { + this.phoneNumberType = Optional.of(phoneNumberType.get()); + } + return this; + } + public PhoneNumber build() { return new PhoneNumber(createdAt, modifiedAt, phoneNumber, phoneNumberType, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java b/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java index 9b7396157..6ae4aabe2 100644 --- a/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java +++ b/src/main/java/com/merge/api/crm/types/PhoneNumberRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -47,26 +50,62 @@ private PhoneNumberRequest( /** * @return The phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return The phone number's type. */ - @JsonProperty("phone_number_type") + @JsonIgnore public Optional getPhoneNumberType() { + if (phoneNumberType == null) { + return Optional.empty(); + } return phoneNumberType; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number_type") + private Optional _getPhoneNumberType() { + return phoneNumberType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -139,6 +178,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

      The phone number's type.

      */ @@ -153,6 +203,17 @@ public Builder phoneNumberType(String phoneNumberType) { return this; } + public Builder phoneNumberType(Nullable phoneNumberType) { + if (phoneNumberType.isNull()) { + this.phoneNumberType = null; + } else if (phoneNumberType.isEmpty()) { + this.phoneNumberType = Optional.empty(); + } else { + this.phoneNumberType = Optional.of(phoneNumberType.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -164,6 +225,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -175,6 +247,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public PhoneNumberRequest build() { return new PhoneNumberRequest( phoneNumber, phoneNumberType, integrationParams, linkedAccountParams, 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/RemoteField.java b/src/main/java/com/merge/api/crm/types/RemoteField.java index d94ea3408..d27b7a802 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteField.java +++ b/src/main/java/com/merge/api/crm/types/RemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteF return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java b/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java index 847a6378e..23610ad11 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); 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..483cb524f 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClass.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -108,8 +111,11 @@ public Optional getFieldFormat() { return fieldFormat; } - @JsonProperty("field_choices") + @JsonIgnore public Optional> getFieldChoices() { + if (fieldChoices == null) { + return Optional.empty(); + } return fieldChoices; } @@ -118,6 +124,12 @@ public Optional getItemSchema() { return itemSchema; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_choices") + private Optional> _getFieldChoices() { + return fieldChoices; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -306,6 +318,17 @@ public Builder fieldChoices(List fieldChoices) return this; } + public Builder fieldChoices(Nullable> fieldChoices) { + if (fieldChoices.isNull()) { + this.fieldChoices = null; + } else if (fieldChoices.isEmpty()) { + this.fieldChoices = Optional.empty(); + } else { + this.fieldChoices = Optional.of(fieldChoices.get()); + } + return this; + } + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) public Builder itemSchema(Optional itemSchema) { this.itemSchema = itemSchema; diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java index 79c2d557f..7ced34f67 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassFieldChoicesItem.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -34,13 +37,31 @@ private RemoteFieldClassFieldChoicesItem( this.additionalProperties = additionalProperties; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { return displayName; } @@ -101,6 +122,17 @@ public Builder value(JsonNode value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public Builder displayName(Optional displayName) { this.displayName = displayName; @@ -112,6 +144,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + public RemoteFieldClassFieldChoicesItem build() { return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java index a061aeb51..0699b0442 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClass.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -85,18 +88,27 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } return displayName; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -115,13 +127,49 @@ public Optional getFieldFormat( return fieldFormat; } - @JsonProperty("field_choices") + @JsonIgnore public Optional> getFieldChoices() { + if (fieldChoices == null) { + return Optional.empty(); + } return fieldChoices; } - @JsonProperty("item_schema") + @JsonIgnore public Optional getItemSchema() { + if (itemSchema == null) { + return Optional.empty(); + } + return itemSchema; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_choices") + private Optional> _getFieldChoices() { + return fieldChoices; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item_schema") + private Optional _getItemSchema() { return itemSchema; } @@ -254,6 +302,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + @JsonSetter(value = "remote_key_name", nulls = Nulls.SKIP) public Builder remoteKeyName(Optional remoteKeyName) { this.remoteKeyName = remoteKeyName; @@ -265,6 +324,17 @@ public Builder remoteKeyName(String remoteKeyName) { return this; } + public Builder remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -276,6 +346,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_required", nulls = Nulls.SKIP) public Builder isRequired(Optional isRequired) { this.isRequired = isRequired; @@ -320,6 +401,17 @@ public Builder fieldChoices(List> fieldChoices) { + if (fieldChoices.isNull()) { + this.fieldChoices = null; + } else if (fieldChoices.isEmpty()) { + this.fieldChoices = Optional.empty(); + } else { + this.fieldChoices = Optional.of(fieldChoices.get()); + } + return this; + } + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) public Builder itemSchema(Optional itemSchema) { this.itemSchema = itemSchema; @@ -331,6 +423,17 @@ public Builder itemSchema(RemoteFieldClassForCustomObjectClassItemSchema itemSch return this; } + public Builder itemSchema(Nullable itemSchema) { + if (itemSchema.isNull()) { + this.itemSchema = null; + } else if (itemSchema.isEmpty()) { + this.itemSchema = Optional.empty(); + } else { + this.itemSchema = Optional.of(itemSchema.get()); + } + return this; + } + public RemoteFieldClassForCustomObjectClass build() { return new RemoteFieldClassForCustomObjectClass( createdAt, diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java index 96c96203a..c59e71cd4 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassFieldChoicesItem.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -34,13 +37,31 @@ private RemoteFieldClassForCustomObjectClassFieldChoicesItem( this.additionalProperties = additionalProperties; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { return displayName; } @@ -102,6 +123,17 @@ public Builder value(JsonNode value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public Builder displayName(Optional displayName) { this.displayName = displayName; @@ -113,6 +145,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + public RemoteFieldClassForCustomObjectClassFieldChoicesItem build() { return new RemoteFieldClassForCustomObjectClassFieldChoicesItem(value, displayName, additionalProperties); } diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java index da45c3a8c..d0e412fb9 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldClassForCustomObjectClassItemSchema.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private RemoteFieldClassForCustomObjectClassItemSchema( this.additionalProperties = additionalProperties; } - @JsonProperty("item_type") + @JsonIgnore public Optional getItemType() { + if (itemType == null) { + return Optional.empty(); + } return itemType; } - @JsonProperty("item_format") + @JsonIgnore public Optional getItemFormat() { + if (itemFormat == null) { + return Optional.empty(); + } return itemFormat; } - @JsonProperty("item_choices") + @JsonIgnore public Optional>> getItemChoices() { + if (itemChoices == null) { + return Optional.empty(); + } + return itemChoices; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item_type") + private Optional _getItemType() { + return itemType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item_format") + private Optional _getItemFormat() { + return itemFormat; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("item_choices") + private Optional>> _getItemChoices() { return itemChoices; } @@ -118,6 +148,17 @@ public Builder itemType(String itemType) { return this; } + public Builder itemType(Nullable itemType) { + if (itemType.isNull()) { + this.itemType = null; + } else if (itemType.isEmpty()) { + this.itemType = Optional.empty(); + } else { + this.itemType = Optional.of(itemType.get()); + } + return this; + } + @JsonSetter(value = "item_format", nulls = Nulls.SKIP) public Builder itemFormat(Optional itemFormat) { this.itemFormat = itemFormat; @@ -129,6 +170,17 @@ public Builder itemFormat(String itemFormat) { return this; } + public Builder itemFormat(Nullable itemFormat) { + if (itemFormat.isNull()) { + this.itemFormat = null; + } else if (itemFormat.isEmpty()) { + this.itemFormat = Optional.empty(); + } else { + this.itemFormat = Optional.of(itemFormat.get()); + } + return this; + } + @JsonSetter(value = "item_choices", nulls = Nulls.SKIP) public Builder itemChoices(Optional>> itemChoices) { this.itemChoices = itemChoices; @@ -140,6 +192,17 @@ public Builder itemChoices(List> itemChoices) { return this; } + public Builder itemChoices(Nullable>> itemChoices) { + if (itemChoices.isNull()) { + this.itemChoices = null; + } else if (itemChoices.isEmpty()) { + this.itemChoices = Optional.empty(); + } else { + this.itemChoices = Optional.of(itemChoices.get()); + } + return this; + } + public RemoteFieldClassForCustomObjectClassItemSchema build() { return new RemoteFieldClassForCustomObjectClassItemSchema( itemType, itemFormat, itemChoices, additionalProperties); diff --git a/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java index 74f4e557d..21882af19 100644 --- a/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java +++ b/src/main/java/com/merge/api/crm/types/RemoteFieldRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java index b158bac66..b1e504296 100644 --- a/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/crm/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/crm/types/Stage.java b/src/main/java/com/merge/api/crm/types/Stage.java index 3e93d75f0..86f9f987e 100644 --- a/src/main/java/com/merge/api/crm/types/Stage.java +++ b/src/main/java/com/merge/api/crm/types/Stage.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,8 +104,11 @@ public Optional getModifiedAt() { /** * @return The stage's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -111,13 +120,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -126,6 +141,30 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -235,6 +274,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -277,6 +327,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + 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.

      */ @@ -302,6 +363,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -313,6 +385,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..8044384e5 100644 --- a/src/main/java/com/merge/api/crm/types/StagesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -408,6 +420,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public StagesListRequest build() { return new StagesListRequest( createdAfter, 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..f6910c855 100644 --- a/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/StagesRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ 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..5bd774634 100644 --- a/src/main/java/com/merge/api/crm/types/Task.java +++ b/src/main/java/com/merge/api/crm/types/Task.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,56 +132,77 @@ public Optional getModifiedAt() { /** * @return The task's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } /** * @return The task's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The task's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The task's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The task's opportunity. */ - @JsonProperty("opportunity") + @JsonIgnore public Optional getOpportunity() { + if (opportunity == null) { + return Optional.empty(); + } return opportunity; } /** * @return When the task is completed. */ - @JsonProperty("completed_date") + @JsonIgnore public Optional getCompletedDate() { + if (completedDate == null) { + return Optional.empty(); + } return completedDate; } /** * @return When the task is due. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -186,8 +213,11 @@ public Optional getDueDate() { *
    • CLOSED - CLOSED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -199,13 +229,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -214,6 +250,72 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("opportunity") + private Optional _getOpportunity() { + return opportunity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_date") + private Optional _getCompletedDate() { + return completedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -358,6 +460,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -400,6 +513,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

    The task's content.

    */ @@ -414,6 +538,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

    The task's owner.

    */ @@ -428,6 +563,17 @@ public Builder owner(TaskOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The task's account.

    */ @@ -442,6 +588,17 @@ public Builder account(TaskAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The task's opportunity.

    */ @@ -456,6 +613,17 @@ public Builder opportunity(TaskOpportunity opportunity) { return this; } + public Builder opportunity(Nullable opportunity) { + if (opportunity.isNull()) { + this.opportunity = null; + } else if (opportunity.isEmpty()) { + this.opportunity = Optional.empty(); + } else { + this.opportunity = Optional.of(opportunity.get()); + } + return this; + } + /** *

    When the task is completed.

    */ @@ -470,6 +638,17 @@ public Builder completedDate(OffsetDateTime completedDate) { return this; } + public Builder completedDate(Nullable completedDate) { + if (completedDate.isNull()) { + this.completedDate = null; + } else if (completedDate.isEmpty()) { + this.completedDate = Optional.empty(); + } else { + this.completedDate = Optional.of(completedDate.get()); + } + return this; + } + /** *

    When the task is due.

    */ @@ -484,6 +663,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

    The task's status.

    *
      @@ -502,6 +692,17 @@ public Builder status(TaskStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + 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.

      */ @@ -527,6 +728,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -538,6 +750,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..b4787a8f6 100644 --- a/src/main/java/com/merge/api/crm/types/TaskRequest.java +++ b/src/main/java/com/merge/api/crm/types/TaskRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -77,56 +80,77 @@ private TaskRequest( /** * @return The task's subject. */ - @JsonProperty("subject") + @JsonIgnore public Optional getSubject() { + if (subject == null) { + return Optional.empty(); + } return subject; } /** * @return The task's content. */ - @JsonProperty("content") + @JsonIgnore public Optional getContent() { + if (content == null) { + return Optional.empty(); + } return content; } /** * @return The task's owner. */ - @JsonProperty("owner") + @JsonIgnore public Optional getOwner() { + if (owner == null) { + return Optional.empty(); + } return owner; } /** * @return The task's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The task's opportunity. */ - @JsonProperty("opportunity") + @JsonIgnore public Optional getOpportunity() { + if (opportunity == null) { + return Optional.empty(); + } return opportunity; } /** * @return When the task is completed. */ - @JsonProperty("completed_date") + @JsonIgnore public Optional getCompletedDate() { + if (completedDate == null) { + return Optional.empty(); + } return completedDate; } /** * @return When the task is due. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -137,18 +161,27 @@ public Optional getDueDate() { *
    • CLOSED - CLOSED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -157,6 +190,66 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("subject") + private Optional _getSubject() { + return subject; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content") + private Optional _getContent() { + return content; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("owner") + private Optional _getOwner() { + return owner; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("opportunity") + private Optional _getOpportunity() { + return opportunity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_date") + private Optional _getCompletedDate() { + return completedDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +358,17 @@ public Builder subject(String subject) { return this; } + public Builder subject(Nullable subject) { + if (subject.isNull()) { + this.subject = null; + } else if (subject.isEmpty()) { + this.subject = Optional.empty(); + } else { + this.subject = Optional.of(subject.get()); + } + return this; + } + /** *

    The task's content.

    */ @@ -279,6 +383,17 @@ public Builder content(String content) { return this; } + public Builder content(Nullable content) { + if (content.isNull()) { + this.content = null; + } else if (content.isEmpty()) { + this.content = Optional.empty(); + } else { + this.content = Optional.of(content.get()); + } + return this; + } + /** *

    The task's owner.

    */ @@ -293,6 +408,17 @@ public Builder owner(TaskRequestOwner owner) { return this; } + public Builder owner(Nullable owner) { + if (owner.isNull()) { + this.owner = null; + } else if (owner.isEmpty()) { + this.owner = Optional.empty(); + } else { + this.owner = Optional.of(owner.get()); + } + return this; + } + /** *

    The task's account.

    */ @@ -307,6 +433,17 @@ public Builder account(TaskRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

    The task's opportunity.

    */ @@ -321,6 +458,17 @@ public Builder opportunity(TaskRequestOpportunity opportunity) { return this; } + public Builder opportunity(Nullable opportunity) { + if (opportunity.isNull()) { + this.opportunity = null; + } else if (opportunity.isEmpty()) { + this.opportunity = Optional.empty(); + } else { + this.opportunity = Optional.of(opportunity.get()); + } + return this; + } + /** *

    When the task is completed.

    */ @@ -335,6 +483,17 @@ public Builder completedDate(OffsetDateTime completedDate) { return this; } + public Builder completedDate(Nullable completedDate) { + if (completedDate.isNull()) { + this.completedDate = null; + } else if (completedDate.isEmpty()) { + this.completedDate = Optional.empty(); + } else { + this.completedDate = Optional.of(completedDate.get()); + } + return this; + } + /** *

    When the task is due.

    */ @@ -349,6 +508,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

    The task's status.

    *
      @@ -367,6 +537,17 @@ public Builder status(TaskRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -378,6 +559,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -389,6 +581,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..cd19385d3 100644 --- a/src/main/java/com/merge/api/crm/types/TasksListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TasksListRequest build() { return new TasksListRequest( expand, diff --git a/src/main/java/com/merge/api/crm/types/TasksMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/crm/types/TasksMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..4a3bde181 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/TasksMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TasksMetaPatchRetrieveRequest.Builder.class) +public final class TasksMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private TasksMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TasksMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TasksMetaPatchRetrieveRequest other) { + return this; + } + + public TasksMetaPatchRetrieveRequest build() { + return new TasksMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..f919caac4 100644 --- a/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/TasksRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ diff --git a/src/main/java/com/merge/api/crm/types/User.java b/src/main/java/com/merge/api/crm/types/User.java index 3a8aa2bdc..554308f28 100644 --- a/src/main/java/com/merge/api/crm/types/User.java +++ b/src/main/java/com/merge/api/crm/types/User.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,24 +112,33 @@ public Optional getModifiedAt() { /** * @return The user's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The user's email address. */ - @JsonProperty("email") + @JsonIgnore public Optional getEmail() { + if (email == null) { + return Optional.empty(); + } return email; } /** * @return Whether or not the user is active. */ - @JsonProperty("is_active") + @JsonIgnore public Optional getIsActive() { + if (isActive == null) { + return Optional.empty(); + } return isActive; } @@ -135,13 +150,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -150,6 +171,42 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + private Optional _getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_active") + private Optional _getIsActive() { + return isActive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -269,6 +326,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -311,6 +379,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      The user's email address.

      */ @@ -325,6 +404,17 @@ public Builder email(String email) { return this; } + public Builder email(Nullable email) { + if (email.isNull()) { + this.email = null; + } else if (email.isEmpty()) { + this.email = Optional.empty(); + } else { + this.email = Optional.of(email.get()); + } + return this; + } + /** *

      Whether or not the user is active.

      */ @@ -339,6 +429,17 @@ public Builder isActive(Boolean isActive) { return this; } + public Builder isActive(Nullable isActive) { + if (isActive.isNull()) { + this.isActive = null; + } else if (isActive.isEmpty()) { + this.isActive = Optional.empty(); + } else { + this.isActive = Optional.of(isActive.get()); + } + 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.

      */ @@ -364,6 +465,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -375,6 +487,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/crm/types/UsersIgnoreCreateRequest.java b/src/main/java/com/merge/api/crm/types/UsersIgnoreCreateRequest.java new file mode 100644 index 000000000..1d0f06651 --- /dev/null +++ b/src/main/java/com/merge/api/crm/types/UsersIgnoreCreateRequest.java @@ -0,0 +1,102 @@ +/** + * 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 = UsersIgnoreCreateRequest.Builder.class) +public final class UsersIgnoreCreateRequest { + private final IgnoreCommonModelRequest body; + + private final Map additionalProperties; + + private UsersIgnoreCreateRequest(IgnoreCommonModelRequest body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public IgnoreCommonModelRequest getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UsersIgnoreCreateRequest && equalTo((UsersIgnoreCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(UsersIgnoreCreateRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyStage builder() { + return new Builder(); + } + + public interface BodyStage { + _FinalStage body(@NotNull IgnoreCommonModelRequest body); + + Builder from(UsersIgnoreCreateRequest other); + } + + public interface _FinalStage { + UsersIgnoreCreateRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private IgnoreCommonModelRequest body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(UsersIgnoreCreateRequest other) { + body(other.getBody()); + return this; + } + + @java.lang.Override + @JsonSetter("body") + public _FinalStage body(@NotNull IgnoreCommonModelRequest body) { + this.body = body; + return this; + } + + @java.lang.Override + public UsersIgnoreCreateRequest build() { + return new UsersIgnoreCreateRequest(body, additionalProperties); + } + } +} 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..49d214ca2 100644 --- a/src/main/java/com/merge/api/crm/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/crm/types/UsersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -103,8 +106,11 @@ public Optional getCursor() { /** * @return If provided, will only return users with this email. */ - @JsonProperty("email") + @JsonIgnore public Optional getEmail() { + if (email == null) { + return Optional.empty(); + } return email; } @@ -167,8 +173,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email") + private Optional _getEmail() { + return email; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -327,6 +348,17 @@ public Builder email(String email) { return this; } + public Builder email(Nullable email) { + if (email.isNull()) { + this.email = null; + } else if (email.isEmpty()) { + this.email = Optional.empty(); + } else { + this.email = Optional.of(email.get()); + } + 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.

      */ @@ -439,6 +471,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public UsersListRequest build() { return new UsersListRequest( createdAfter, 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..d708eb072 100644 --- a/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/crm/types/UsersRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

      */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ diff --git a/src/main/java/com/merge/api/filestorage/AccountTokenClient.java b/src/main/java/com/merge/api/filestorage/AccountTokenClient.java index c1d0b59f1..0c96d5c1e 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.AccountTokenRetrieveRequest; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, 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..a6de51ae3 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.AccountTokenRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java index f06c66060..56445e42b 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncAsyncPassthroughClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveRequest; import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; import com.merge.api.filestorage.types.DataPassthroughRequest; import java.util.concurrent.CompletableFuture; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java index 5eb1e9af9..703a10122 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncFieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsDestroyRequest; import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; import com.merge.api.filestorage.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java b/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java index 8e7898f6b..c6ee8c825 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncIssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.filestorage.types.Issue; import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.IssuesRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncIssuesClient { @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..225bd80c3 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.AccountTokenRetrieveRequest; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..da0e7526f 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveRequest; import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; import com.merge.api.filestorage.types.DataPassthroughRequest; import java.io.IOException; @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..2de2dec55 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..94f6d15e3 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawDrivesClient.java @@ -18,7 +18,6 @@ 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; @@ -125,17 +124,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDriveList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DrivesListRequest nextRequest = DrivesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -147,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,17 +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(), 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..3a8d9203e 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsDestroyRequest; import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; 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 +86,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 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -304,19 +299,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 +373,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 +428,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..31d55d925 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFilesClient.java @@ -28,10 +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; import okhttp3.Call; @@ -159,17 +156,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFileList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FilesListRequest nextRequest = FilesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -181,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)); @@ -225,12 +220,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 +243,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 +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(), 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 +396,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)); @@ -452,7 +438,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 +459,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)); @@ -577,10 +562,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedDownloadRequestMetaList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() .from(request) .cursor(startingAfter) @@ -589,7 +575,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return downloadRequestMetaList(nextRequest, requestOptions) .get() @@ -601,12 +587,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 +634,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..5916944fe 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawFoldersClient.java @@ -21,10 +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; import okhttp3.Call; @@ -144,35 +141,32 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFolderList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FoldersListRequest nextRequest = FoldersListRequest.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); - } - }), + new SyncPagingIterable(!startingAfter.isEmpty(), 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)); @@ -211,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); } @@ -236,19 +228,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 +306,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 +359,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..a59b1b51b 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -125,17 +124,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -147,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)); @@ -220,17 +217,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..213215bfb 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.filestorage.types.Issue; import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.IssuesRetrieveRequest; import com.merge.api.filestorage.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; @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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..de430bee3 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkTokenClient.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(), 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..89e6cb164 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -138,10 +137,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); 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..e439eed7d 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -82,10 +81,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) .cursor(startingAfter) @@ -93,7 +93,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -105,12 +105,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..7bc0da6ee 100644 --- a/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/filestorage/AsyncRawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -125,17 +124,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -147,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,17 +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(), 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/FieldMappingClient.java b/src/main/java/com/merge/api/filestorage/FieldMappingClient.java index acc221467..b40ed1a3e 100644 --- a/src/main/java/com/merge/api/filestorage/FieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/FieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsDestroyRequest; import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; import com.merge.api.filestorage.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/filestorage/IssuesClient.java b/src/main/java/com/merge/api/filestorage/IssuesClient.java index d76a2872b..011c8d7d2 100644 --- a/src/main/java/com/merge/api/filestorage/IssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/IssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.filestorage.types.Issue; import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.IssuesRetrieveRequest; public class IssuesClient { protected final ClientOptions clientOptions; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..6215e7802 100644 --- a/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAccountTokenClient.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.AccountTokenRetrieveRequest; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..785d71902 100644 --- a/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.filestorage.types.AsyncPassthroughReciept; +import com.merge.api.filestorage.types.AsyncPassthroughRetrieveRequest; import com.merge.api.filestorage.types.AsyncPassthroughRetrieveResponse; import com.merge.api.filestorage.types.DataPassthroughRequest; import java.io.IOException; @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..e8ad421a3 100644 --- a/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/filestorage/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..9c4444f3b 100644 --- a/src/main/java/com/merge/api/filestorage/RawDrivesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawDrivesClient.java @@ -18,7 +18,6 @@ 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; @@ -117,27 +116,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDriveList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DrivesListRequest nextRequest = DrivesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -189,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(), 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..2bf1b4486 100644 --- a/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.filestorage.types.ExternalTargetFieldApiResponse; import com.merge.api.filestorage.types.FieldMappingApiInstanceResponse; import com.merge.api.filestorage.types.FieldMappingInstanceResponse; +import com.merge.api.filestorage.types.FieldMappingsDestroyRequest; import com.merge.api.filestorage.types.FieldMappingsRetrieveRequest; import com.merge.api.filestorage.types.PatchedEditFieldMappingRequest; 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 +79,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 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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 +302,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 +342,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..bd0d5021c 100644 --- a/src/main/java/com/merge/api/filestorage/RawFilesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFilesClient.java @@ -28,10 +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; import okhttp3.OkHttpClient; @@ -151,27 +148,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFileList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FilesListRequest nextRequest = FilesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -200,12 +194,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 +214,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 +276,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,11 +336,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); } @@ -385,7 +368,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 +386,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); } @@ -493,10 +473,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedDownloadRequestMetaList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDownloadRequestMetaList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FilesDownloadRequestMetaListRequest nextRequest = FilesDownloadRequestMetaListRequest.builder() .from(request) .cursor(startingAfter) @@ -504,17 +485,13 @@ public MergeApiHttpResponse> downloadReq List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> downloadRequestMetaList( + !startingAfter.isEmpty(), result, parsedResponse, () -> downloadRequestMetaList( 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); } @@ -547,16 +524,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..1b60925d8 100644 --- a/src/main/java/com/merge/api/filestorage/RawFoldersClient.java +++ b/src/main/java/com/merge/api/filestorage/RawFoldersClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -136,27 +133,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedFolderList.class); + String startingAfter = parsedResponse.getNext().orElse(null); FoldersListRequest nextRequest = FoldersListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -185,12 +179,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 +199,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 +262,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 +301,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..2aa29bee0 100644 --- a/src/main/java/com/merge/api/filestorage/RawGroupsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -117,27 +116,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -193,16 +189,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..baa957f76 100644 --- a/src/main/java/com/merge/api/filestorage/RawIssuesClient.java +++ b/src/main/java/com/merge/api/filestorage/RawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.filestorage.types.Issue; import com.merge.api.filestorage.types.IssuesListRequest; +import com.merge.api.filestorage.types.IssuesRetrieveRequest; import com.merge.api.filestorage.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; @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("filestorage/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..b2f758882 100644 --- a/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/filestorage/RawLinkTokenClient.java @@ -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..25ebfb086 100644 --- a/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/filestorage/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..41cd4853f 100644 --- a/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/filestorage/RawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -74,28 +73,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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/filestorage/RawUsersClient.java b/src/main/java/com/merge/api/filestorage/RawUsersClient.java index 282b07cb5..2cdb189e8 100644 --- a/src/main/java/com/merge/api/filestorage/RawUsersClient.java +++ b/src/main/java/com/merge/api/filestorage/RawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -117,27 +116,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -188,16 +184,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..87d942dce 100644 --- a/src/main/java/com/merge/api/filestorage/types/AccountDetails.java +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(AccountDetailsCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..b5d4b45af 100644 --- a/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/filestorage/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java b/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java index 837a5fafd..89b3dd623 100644 --- a/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/filestorage/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

      Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

      */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

      Company logo in square shape.

      */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

      The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

      */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

      Category or categories this integration is in beta status for.

      */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

      Company logo in square shape.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

      Company logo in rectangular shape.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/filestorage/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..9eaeaa290 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..c57b650a2 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java b/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java index 348b77f1a..b15a5f275 100644 --- a/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/filestorage/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

      The User's email at the time of this Event occurring.

      */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java index 53f2f58ff..8cecdcabd 100644 --- a/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

      The data with the request. You must include a request_format parameter matching the data's format

      */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

      Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

      */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

      */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

      */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. diff --git a/src/main/java/com/merge/api/filestorage/types/Drive.java b/src/main/java/com/merge/api/filestorage/types/Drive.java index c0ab3fc33..2195123db 100644 --- a/src/main/java/com/merge/api/filestorage/types/Drive.java +++ b/src/main/java/com/merge/api/filestorage/types/Drive.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,24 +108,33 @@ public Optional getModifiedAt() { /** * @return The drive's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return When the third party's drive was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return The drive's url. */ - @JsonProperty("drive_url") + @JsonIgnore public Optional getDriveUrl() { + if (driveUrl == null) { + return Optional.empty(); + } return driveUrl; } @@ -131,13 +146,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("drive_url") + private Optional _getDriveUrl() { + return driveUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -255,6 +312,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -297,6 +365,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      When the third party's drive was created.

      */ @@ -311,6 +390,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

      The drive's url.

      */ @@ -325,6 +415,17 @@ public Builder driveUrl(String driveUrl) { return this; } + public Builder driveUrl(Nullable driveUrl) { + if (driveUrl.isNull()) { + this.driveUrl = null; + } else if (driveUrl.isEmpty()) { + this.driveUrl = Optional.empty(); + } else { + this.driveUrl = Optional.of(driveUrl.get()); + } + 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.

      */ @@ -350,6 +451,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -361,6 +473,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Drive build() { return new Drive( id, diff --git a/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java b/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java index 7dd00be88..a482da609 100644 --- a/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/DrivesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -139,8 +142,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return drives with this name. This performs an exact match. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -155,8 +161,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -380,6 +401,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      Number of results to return per page.

      */ @@ -408,6 +440,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public DrivesListRequest build() { return new DrivesListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java b/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java index 1bed26824..705e9216e 100644 --- a/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/filestorage/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } diff --git a/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java index be0863dff..65b609909 100644 --- a/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
    • de - de
    • *
    */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

    */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

    */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

    */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

    */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

    The following subset of IETF language tags can be used to configure localization.

    *
      @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

      The boolean that indicates whether initial, periodic, and force syncs will be disabled.

      */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

      A JSON object containing integration-specific configuration options.

      */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

      A JSON object containing integration-specific configuration options.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

      The following subset of IETF language tags can be used to configure localization.

      + *
        + *
      • en - en
      • + *
      • de - de
      • + *
      + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

      The following subset of IETF language tags can be used to configure localization.

      *
        @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java index 4b5378e7c..ebd59a504 100644 --- a/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/filestorage/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, 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..7e9c7ca3a 100644 --- a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java index 03ff4fc79..eac2fe26a 100644 --- a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index 14df13139..dcaec50be 100644 --- a/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/filestorage/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/filestorage/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..e8a0eeb40 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/filestorage/types/File.java b/src/main/java/com/merge/api/filestorage/types/File.java index 7bc6f1fe2..5726dda94 100644 --- a/src/main/java/com/merge/api/filestorage/types/File.java +++ b/src/main/java/com/merge/api/filestorage/types/File.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -114,8 +117,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -138,64 +144,88 @@ public Optional getModifiedAt() { /** * @return The file's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The URL to access the file. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The URL that produces a thumbnail preview of the file. Typically an image. */ - @JsonProperty("file_thumbnail_url") + @JsonIgnore public Optional getFileThumbnailUrl() { + if (fileThumbnailUrl == null) { + return Optional.empty(); + } return fileThumbnailUrl; } /** * @return The file's size, in bytes. */ - @JsonProperty("size") + @JsonIgnore public Optional getSize() { + if (size == null) { + return Optional.empty(); + } return size; } /** * @return The file's mime type. */ - @JsonProperty("mime_type") + @JsonIgnore public Optional getMimeType() { + if (mimeType == null) { + return Optional.empty(); + } return mimeType; } /** * @return The file's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The folder that the file belongs to. */ - @JsonProperty("folder") + @JsonIgnore public Optional getFolder() { + if (folder == null) { + return Optional.empty(); + } return folder; } /** * @return 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. */ - @JsonProperty("checksum") + @JsonIgnore public Optional> getChecksum() { + if (checksum == null) { + return Optional.empty(); + } return checksum; } @@ -210,24 +240,33 @@ public Optional getPermissions() { /** * @return The drive that the file belongs to. */ - @JsonProperty("drive") + @JsonIgnore public Optional getDrive() { + if (drive == null) { + return Optional.empty(); + } return drive; } /** * @return When the third party's file was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's file was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -239,13 +278,103 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_thumbnail_url") + private Optional _getFileThumbnailUrl() { + return fileThumbnailUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("size") + private Optional _getSize() { + return size; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mime_type") + private Optional _getMimeType() { + return mimeType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("folder") + private Optional _getFolder() { + return folder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("checksum") + private Optional> _getChecksum() { + return checksum; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("drive") + private Optional _getDrive() { + return drive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -408,6 +537,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -450,6 +590,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The URL to access the file.

        */ @@ -464,6 +615,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

        The URL that produces a thumbnail preview of the file. Typically an image.

        */ @@ -478,6 +640,17 @@ public Builder fileThumbnailUrl(String fileThumbnailUrl) { return this; } + public Builder fileThumbnailUrl(Nullable fileThumbnailUrl) { + if (fileThumbnailUrl.isNull()) { + this.fileThumbnailUrl = null; + } else if (fileThumbnailUrl.isEmpty()) { + this.fileThumbnailUrl = Optional.empty(); + } else { + this.fileThumbnailUrl = Optional.of(fileThumbnailUrl.get()); + } + return this; + } + /** *

        The file's size, in bytes.

        */ @@ -492,6 +665,17 @@ public Builder size(Long size) { return this; } + public Builder size(Nullable size) { + if (size.isNull()) { + this.size = null; + } else if (size.isEmpty()) { + this.size = Optional.empty(); + } else { + this.size = Optional.of(size.get()); + } + return this; + } + /** *

        The file's mime type.

        */ @@ -506,6 +690,17 @@ public Builder mimeType(String mimeType) { return this; } + public Builder mimeType(Nullable mimeType) { + if (mimeType.isNull()) { + this.mimeType = null; + } else if (mimeType.isEmpty()) { + this.mimeType = Optional.empty(); + } else { + this.mimeType = Optional.of(mimeType.get()); + } + return this; + } + /** *

        The file's description.

        */ @@ -520,6 +715,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The folder that the file belongs to.

        */ @@ -534,6 +740,17 @@ public Builder folder(FileFolder folder) { return this; } + public Builder folder(Nullable folder) { + if (folder.isNull()) { + this.folder = null; + } else if (folder.isEmpty()) { + this.folder = Optional.empty(); + } else { + this.folder = Optional.of(folder.get()); + } + return this; + } + /** *

        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.

        */ @@ -548,6 +765,17 @@ public Builder checksum(Map checksum) { return this; } + public Builder checksum(Nullable> checksum) { + if (checksum.isNull()) { + this.checksum = null; + } else if (checksum.isEmpty()) { + this.checksum = Optional.empty(); + } else { + this.checksum = Optional.of(checksum.get()); + } + return this; + } + /** *

        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.

        */ @@ -576,6 +804,17 @@ public Builder drive(FileDrive drive) { return this; } + public Builder drive(Nullable drive) { + if (drive.isNull()) { + this.drive = null; + } else if (drive.isEmpty()) { + this.drive = Optional.empty(); + } else { + this.drive = Optional.of(drive.get()); + } + return this; + } + /** *

        When the third party's file was created.

        */ @@ -590,6 +829,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the third party's file was updated.

        */ @@ -604,6 +854,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

        */ @@ -629,6 +890,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -640,6 +912,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public File build() { return new File( id, diff --git a/src/main/java/com/merge/api/filestorage/types/FilePermissions.java b/src/main/java/com/merge/api/filestorage/types/FilePermissions.java index ca41ddfbb..a06aec1cd 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilePermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FilePermissions.java @@ -38,7 +38,7 @@ public T visit(Visitor visitor) { } else if (this.type == 1) { return visitor.visit((Permission) this.value); } else if (this.type == 2) { - return visitor.visit((List) this.value); + return visitor.visit((List) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -71,7 +71,7 @@ public static FilePermissions of(Permission value) { return new FilePermissions(value, 1); } - public static FilePermissions of(List value) { + public static FilePermissions of(List value) { return new FilePermissions(value, 2); } @@ -80,7 +80,7 @@ public interface Visitor { T visit(Permission value); - T visit(List value); + T visit(List value); } static final class Deserializer extends StdDeserializer { @@ -101,7 +101,7 @@ public FilePermissions deserialize(JsonParser p, DeserializationContext context) } try { return of(ObjectMappers.JSON_MAPPER.convertValue( - value, new TypeReference>() {})); + value, new TypeReference>() {})); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FilePermissionsTwoItem.java similarity index 74% rename from src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FilePermissionsTwoItem.java index e376c613f..ab73cfa87 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilePermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FilePermissionsTwoItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = FilePermissionsItem.Deserializer.class) -public final class FilePermissionsItem { +@JsonDeserialize(using = FilePermissionsTwoItem.Deserializer.class) +public final class FilePermissionsTwoItem { private final Object value; private final int type; - private FilePermissionsItem(Object value, int type) { + private FilePermissionsTwoItem(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 FilePermissionsItem && equalTo((FilePermissionsItem) other); + return other instanceof FilePermissionsTwoItem && equalTo((FilePermissionsTwoItem) other); } - private boolean equalTo(FilePermissionsItem other) { + private boolean equalTo(FilePermissionsTwoItem other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static FilePermissionsItem of(String value) { - return new FilePermissionsItem(value, 0); + public static FilePermissionsTwoItem of(String value) { + return new FilePermissionsTwoItem(value, 0); } - public static FilePermissionsItem of(Permission value) { - return new FilePermissionsItem(value, 1); + public static FilePermissionsTwoItem of(Permission value) { + return new FilePermissionsTwoItem(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Permission value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(FilePermissionsItem.class); + super(FilePermissionsTwoItem.class); } @java.lang.Override - public FilePermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + public FilePermissionsTwoItem 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/filestorage/types/FileRequest.java b/src/main/java/com/merge/api/filestorage/types/FileRequest.java index 7839c31cd..8b31d1c6a 100644 --- a/src/main/java/com/merge/api/filestorage/types/FileRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -79,64 +82,88 @@ private FileRequest( /** * @return The file's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The URL to access the file. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The URL that produces a thumbnail preview of the file. Typically an image. */ - @JsonProperty("file_thumbnail_url") + @JsonIgnore public Optional getFileThumbnailUrl() { + if (fileThumbnailUrl == null) { + return Optional.empty(); + } return fileThumbnailUrl; } /** * @return The file's size, in bytes. */ - @JsonProperty("size") + @JsonIgnore public Optional getSize() { + if (size == null) { + return Optional.empty(); + } return size; } /** * @return The file's mime type. */ - @JsonProperty("mime_type") + @JsonIgnore public Optional getMimeType() { + if (mimeType == null) { + return Optional.empty(); + } return mimeType; } /** * @return The file's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The folder that the file belongs to. */ - @JsonProperty("folder") + @JsonIgnore public Optional getFolder() { + if (folder == null) { + return Optional.empty(); + } return folder; } /** * @return 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. */ - @JsonProperty("checksum") + @JsonIgnore public Optional> getChecksum() { + if (checksum == null) { + return Optional.empty(); + } return checksum; } @@ -151,18 +178,93 @@ public Optional getPermissions() { /** * @return The drive that the file belongs to. */ - @JsonProperty("drive") + @JsonIgnore public Optional getDrive() { + if (drive == null) { + return Optional.empty(); + } return drive; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_thumbnail_url") + private Optional _getFileThumbnailUrl() { + return fileThumbnailUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("size") + private Optional _getSize() { + return size; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mime_type") + private Optional _getMimeType() { + return mimeType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("folder") + private Optional _getFolder() { + return folder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("checksum") + private Optional> _getChecksum() { + return checksum; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("drive") + private Optional _getDrive() { + return drive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -279,6 +381,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The URL to access the file.

        */ @@ -293,6 +406,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

        The URL that produces a thumbnail preview of the file. Typically an image.

        */ @@ -307,6 +431,17 @@ public Builder fileThumbnailUrl(String fileThumbnailUrl) { return this; } + public Builder fileThumbnailUrl(Nullable fileThumbnailUrl) { + if (fileThumbnailUrl.isNull()) { + this.fileThumbnailUrl = null; + } else if (fileThumbnailUrl.isEmpty()) { + this.fileThumbnailUrl = Optional.empty(); + } else { + this.fileThumbnailUrl = Optional.of(fileThumbnailUrl.get()); + } + return this; + } + /** *

        The file's size, in bytes.

        */ @@ -321,6 +456,17 @@ public Builder size(Long size) { return this; } + public Builder size(Nullable size) { + if (size.isNull()) { + this.size = null; + } else if (size.isEmpty()) { + this.size = Optional.empty(); + } else { + this.size = Optional.of(size.get()); + } + return this; + } + /** *

        The file's mime type.

        */ @@ -335,6 +481,17 @@ public Builder mimeType(String mimeType) { return this; } + public Builder mimeType(Nullable mimeType) { + if (mimeType.isNull()) { + this.mimeType = null; + } else if (mimeType.isEmpty()) { + this.mimeType = Optional.empty(); + } else { + this.mimeType = Optional.of(mimeType.get()); + } + return this; + } + /** *

        The file's description.

        */ @@ -349,6 +506,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The folder that the file belongs to.

        */ @@ -363,6 +531,17 @@ public Builder folder(FileRequestFolder folder) { return this; } + public Builder folder(Nullable folder) { + if (folder.isNull()) { + this.folder = null; + } else if (folder.isEmpty()) { + this.folder = Optional.empty(); + } else { + this.folder = Optional.of(folder.get()); + } + return this; + } + /** *

        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.

        */ @@ -377,6 +556,17 @@ public Builder checksum(Map checksum) { return this; } + public Builder checksum(Nullable> checksum) { + if (checksum.isNull()) { + this.checksum = null; + } else if (checksum.isEmpty()) { + this.checksum = Optional.empty(); + } else { + this.checksum = Optional.of(checksum.get()); + } + return this; + } + /** *

        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.

        */ @@ -405,6 +595,17 @@ public Builder drive(FileRequestDrive drive) { return this; } + public Builder drive(Nullable drive) { + if (drive.isNull()) { + this.drive = null; + } else if (drive.isEmpty()) { + this.drive = Optional.empty(); + } else { + this.drive = Optional.of(drive.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -416,6 +617,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -427,6 +639,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public FileRequest build() { return new FileRequest( name, diff --git a/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java index 9b44fda56..51c17d19a 100644 --- a/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissions.java @@ -38,7 +38,7 @@ public T visit(Visitor visitor) { } else if (this.type == 1) { return visitor.visit((PermissionRequest) this.value); } else if (this.type == 2) { - return visitor.visit((List) this.value); + return visitor.visit((List) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -71,7 +71,7 @@ public static FileRequestPermissions of(PermissionRequest value) { return new FileRequestPermissions(value, 1); } - public static FileRequestPermissions of(List value) { + public static FileRequestPermissions of(List value) { return new FileRequestPermissions(value, 2); } @@ -80,7 +80,7 @@ public interface Visitor { T visit(PermissionRequest value); - T visit(List value); + T visit(List value); } static final class Deserializer extends StdDeserializer { @@ -101,7 +101,7 @@ public FileRequestPermissions deserialize(JsonParser p, DeserializationContext c } try { return of(ObjectMappers.JSON_MAPPER.convertValue( - value, new TypeReference>() {})); + value, new TypeReference>() {})); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsTwoItem.java similarity index 72% rename from src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsTwoItem.java index 514191977..623dc1cec 100644 --- a/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FileRequestPermissionsTwoItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = FileRequestPermissionsItem.Deserializer.class) -public final class FileRequestPermissionsItem { +@JsonDeserialize(using = FileRequestPermissionsTwoItem.Deserializer.class) +public final class FileRequestPermissionsTwoItem { private final Object value; private final int type; - private FileRequestPermissionsItem(Object value, int type) { + private FileRequestPermissionsTwoItem(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 FileRequestPermissionsItem && equalTo((FileRequestPermissionsItem) other); + return other instanceof FileRequestPermissionsTwoItem && equalTo((FileRequestPermissionsTwoItem) other); } - private boolean equalTo(FileRequestPermissionsItem other) { + private boolean equalTo(FileRequestPermissionsTwoItem other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static FileRequestPermissionsItem of(String value) { - return new FileRequestPermissionsItem(value, 0); + public static FileRequestPermissionsTwoItem of(String value) { + return new FileRequestPermissionsTwoItem(value, 0); } - public static FileRequestPermissionsItem of(PermissionRequest value) { - return new FileRequestPermissionsItem(value, 1); + public static FileRequestPermissionsTwoItem of(PermissionRequest value) { + return new FileRequestPermissionsTwoItem(value, 1); } public interface Visitor { @@ -73,13 +73,14 @@ public interface Visitor { T visit(PermissionRequest value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(FileRequestPermissionsItem.class); + super(FileRequestPermissionsTwoItem.class); } @java.lang.Override - public FileRequestPermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + public FileRequestPermissionsTwoItem 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/filestorage/types/FilesListRequest.java b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java index 463de88d9..48b1bf508 100644 --- a/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FilesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -193,8 +196,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return files with this name. This performs an exact match. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -217,8 +223,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -528,6 +549,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at.

        */ @@ -570,6 +602,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public FilesListRequest build() { return new FilesListRequest( expand, diff --git a/src/main/java/com/merge/api/filestorage/types/Folder.java b/src/main/java/com/merge/api/filestorage/types/Folder.java index 84b818411..d998621f7 100644 --- a/src/main/java/com/merge/api/filestorage/types/Folder.java +++ b/src/main/java/com/merge/api/filestorage/types/Folder.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,48 +132,66 @@ public Optional getModifiedAt() { /** * @return The folder's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The URL to access the folder. */ - @JsonProperty("folder_url") + @JsonIgnore public Optional getFolderUrl() { + if (folderUrl == null) { + return Optional.empty(); + } return folderUrl; } /** * @return The folder's size, in bytes. */ - @JsonProperty("size") + @JsonIgnore public Optional getSize() { + if (size == null) { + return Optional.empty(); + } return size; } /** * @return The folder's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The folder that the folder belongs to. */ - @JsonProperty("parent_folder") + @JsonIgnore public Optional getParentFolder() { + if (parentFolder == null) { + return Optional.empty(); + } return parentFolder; } /** * @return The drive that the folder belongs to. */ - @JsonProperty("drive") + @JsonIgnore public Optional getDrive() { + if (drive == null) { + return Optional.empty(); + } return drive; } @@ -182,16 +206,22 @@ public Optional getPermissions() { /** * @return When the third party's folder was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's folder was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -203,13 +233,85 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("folder_url") + private Optional _getFolderUrl() { + return folderUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("size") + private Optional _getSize() { + return size; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_folder") + private Optional _getParentFolder() { + return parentFolder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("drive") + private Optional _getDrive() { + return drive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -357,6 +459,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -399,6 +512,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The URL to access the folder.

        */ @@ -413,6 +537,17 @@ public Builder folderUrl(String folderUrl) { return this; } + public Builder folderUrl(Nullable folderUrl) { + if (folderUrl.isNull()) { + this.folderUrl = null; + } else if (folderUrl.isEmpty()) { + this.folderUrl = Optional.empty(); + } else { + this.folderUrl = Optional.of(folderUrl.get()); + } + return this; + } + /** *

        The folder's size, in bytes.

        */ @@ -427,6 +562,17 @@ public Builder size(Long size) { return this; } + public Builder size(Nullable size) { + if (size.isNull()) { + this.size = null; + } else if (size.isEmpty()) { + this.size = Optional.empty(); + } else { + this.size = Optional.of(size.get()); + } + return this; + } + /** *

        The folder's description.

        */ @@ -441,6 +587,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The folder that the folder belongs to.

        */ @@ -455,6 +612,17 @@ public Builder parentFolder(FolderParentFolder parentFolder) { return this; } + public Builder parentFolder(Nullable parentFolder) { + if (parentFolder.isNull()) { + this.parentFolder = null; + } else if (parentFolder.isEmpty()) { + this.parentFolder = Optional.empty(); + } else { + this.parentFolder = Optional.of(parentFolder.get()); + } + return this; + } + /** *

        The drive that the folder belongs to.

        */ @@ -469,6 +637,17 @@ public Builder drive(FolderDrive drive) { return this; } + public Builder drive(Nullable drive) { + if (drive.isNull()) { + this.drive = null; + } else if (drive.isEmpty()) { + this.drive = Optional.empty(); + } else { + this.drive = Optional.of(drive.get()); + } + return this; + } + /** *

        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.

        */ @@ -497,6 +676,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

        When the third party's folder was updated.

        */ @@ -511,6 +701,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

        */ @@ -536,6 +737,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -547,6 +759,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Folder build() { return new Folder( id, diff --git a/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java b/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java index 2e27b0204..f1f92eaae 100644 --- a/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderPermissions.java @@ -38,7 +38,7 @@ public T visit(Visitor visitor) { } else if (this.type == 1) { return visitor.visit((Permission) this.value); } else if (this.type == 2) { - return visitor.visit((List) this.value); + return visitor.visit((List) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -71,7 +71,7 @@ public static FolderPermissions of(Permission value) { return new FolderPermissions(value, 1); } - public static FolderPermissions of(List value) { + public static FolderPermissions of(List value) { return new FolderPermissions(value, 2); } @@ -80,7 +80,7 @@ public interface Visitor { T visit(Permission value); - T visit(List value); + T visit(List value); } static final class Deserializer extends StdDeserializer { @@ -101,7 +101,7 @@ public FolderPermissions deserialize(JsonParser p, DeserializationContext contex } try { return of(ObjectMappers.JSON_MAPPER.convertValue( - value, new TypeReference>() {})); + value, new TypeReference>() {})); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FolderPermissionsTwoItem.java similarity index 74% rename from src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FolderPermissionsTwoItem.java index ad291a316..ba0025e19 100644 --- a/src/main/java/com/merge/api/filestorage/types/FolderPermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderPermissionsTwoItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = FolderPermissionsItem.Deserializer.class) -public final class FolderPermissionsItem { +@JsonDeserialize(using = FolderPermissionsTwoItem.Deserializer.class) +public final class FolderPermissionsTwoItem { private final Object value; private final int type; - private FolderPermissionsItem(Object value, int type) { + private FolderPermissionsTwoItem(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 FolderPermissionsItem && equalTo((FolderPermissionsItem) other); + return other instanceof FolderPermissionsTwoItem && equalTo((FolderPermissionsTwoItem) other); } - private boolean equalTo(FolderPermissionsItem other) { + private boolean equalTo(FolderPermissionsTwoItem other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static FolderPermissionsItem of(String value) { - return new FolderPermissionsItem(value, 0); + public static FolderPermissionsTwoItem of(String value) { + return new FolderPermissionsTwoItem(value, 0); } - public static FolderPermissionsItem of(Permission value) { - return new FolderPermissionsItem(value, 1); + public static FolderPermissionsTwoItem of(Permission value) { + return new FolderPermissionsTwoItem(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(Permission value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(FolderPermissionsItem.class); + super(FolderPermissionsTwoItem.class); } @java.lang.Override - public FolderPermissionsItem deserialize(JsonParser p, DeserializationContext context) throws IOException { + public FolderPermissionsTwoItem 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/filestorage/types/FolderRequest.java b/src/main/java/com/merge/api/filestorage/types/FolderRequest.java index f1d3b71b2..9c2c84120 100644 --- a/src/main/java/com/merge/api/filestorage/types/FolderRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -67,48 +70,66 @@ private FolderRequest( /** * @return The folder's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The URL to access the folder. */ - @JsonProperty("folder_url") + @JsonIgnore public Optional getFolderUrl() { + if (folderUrl == null) { + return Optional.empty(); + } return folderUrl; } /** * @return The folder's size, in bytes. */ - @JsonProperty("size") + @JsonIgnore public Optional getSize() { + if (size == null) { + return Optional.empty(); + } return size; } /** * @return The folder's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The folder that the folder belongs to. */ - @JsonProperty("parent_folder") + @JsonIgnore public Optional getParentFolder() { + if (parentFolder == null) { + return Optional.empty(); + } return parentFolder; } /** * @return The drive that the folder belongs to. */ - @JsonProperty("drive") + @JsonIgnore public Optional getDrive() { + if (drive == null) { + return Optional.empty(); + } return drive; } @@ -120,13 +141,67 @@ public Optional getPermissions() { return permissions; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("folder_url") + private Optional _getFolderUrl() { + return folderUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("size") + private Optional _getSize() { + return size; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_folder") + private Optional _getParentFolder() { + return parentFolder; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("drive") + private Optional _getDrive() { + return drive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -228,6 +303,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The URL to access the folder.

        */ @@ -242,6 +328,17 @@ public Builder folderUrl(String folderUrl) { return this; } + public Builder folderUrl(Nullable folderUrl) { + if (folderUrl.isNull()) { + this.folderUrl = null; + } else if (folderUrl.isEmpty()) { + this.folderUrl = Optional.empty(); + } else { + this.folderUrl = Optional.of(folderUrl.get()); + } + return this; + } + /** *

        The folder's size, in bytes.

        */ @@ -256,6 +353,17 @@ public Builder size(Long size) { return this; } + public Builder size(Nullable size) { + if (size.isNull()) { + this.size = null; + } else if (size.isEmpty()) { + this.size = Optional.empty(); + } else { + this.size = Optional.of(size.get()); + } + return this; + } + /** *

        The folder's description.

        */ @@ -270,6 +378,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The folder that the folder belongs to.

        */ @@ -284,6 +403,17 @@ public Builder parentFolder(FolderRequestParentFolder parentFolder) { return this; } + public Builder parentFolder(Nullable parentFolder) { + if (parentFolder.isNull()) { + this.parentFolder = null; + } else if (parentFolder.isEmpty()) { + this.parentFolder = Optional.empty(); + } else { + this.parentFolder = Optional.of(parentFolder.get()); + } + return this; + } + /** *

        The drive that the folder belongs to.

        */ @@ -298,6 +428,17 @@ public Builder drive(FolderRequestDrive drive) { return this; } + public Builder drive(Nullable drive) { + if (drive.isNull()) { + this.drive = null; + } else if (drive.isEmpty()) { + this.drive = Optional.empty(); + } else { + this.drive = Optional.of(drive.get()); + } + return this; + } + /** *

        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.

        */ @@ -323,6 +464,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -334,6 +486,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public FolderRequest build() { return new FolderRequest( name, diff --git a/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissions.java b/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissions.java index cacd48077..7a7bc7ee4 100644 --- a/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissions.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissions.java @@ -38,7 +38,7 @@ public T visit(Visitor visitor) { } else if (this.type == 1) { return visitor.visit((PermissionRequest) this.value); } else if (this.type == 2) { - return visitor.visit((List) this.value); + return visitor.visit((List) this.value); } throw new IllegalStateException("Failed to visit value. This should never happen."); } @@ -71,7 +71,7 @@ public static FolderRequestPermissions of(PermissionRequest value) { return new FolderRequestPermissions(value, 1); } - public static FolderRequestPermissions of(List value) { + public static FolderRequestPermissions of(List value) { return new FolderRequestPermissions(value, 2); } @@ -80,7 +80,7 @@ public interface Visitor { T visit(PermissionRequest value); - T visit(List value); + T visit(List value); } static final class Deserializer extends StdDeserializer { @@ -101,7 +101,7 @@ public FolderRequestPermissions deserialize(JsonParser p, DeserializationContext } try { return of(ObjectMappers.JSON_MAPPER.convertValue( - value, new TypeReference>() {})); + value, new TypeReference>() {})); } catch (RuntimeException e) { } throw new JsonParseException(p, "Failed to deserialize"); diff --git a/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsItem.java b/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsTwoItem.java similarity index 72% rename from src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsItem.java rename to src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsTwoItem.java index 8a29ab59c..c9da6d333 100644 --- a/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsItem.java +++ b/src/main/java/com/merge/api/filestorage/types/FolderRequestPermissionsTwoItem.java @@ -13,13 +13,13 @@ import java.io.IOException; import java.util.Objects; -@JsonDeserialize(using = FolderRequestPermissionsItem.Deserializer.class) -public final class FolderRequestPermissionsItem { +@JsonDeserialize(using = FolderRequestPermissionsTwoItem.Deserializer.class) +public final class FolderRequestPermissionsTwoItem { private final Object value; private final int type; - private FolderRequestPermissionsItem(Object value, int type) { + private FolderRequestPermissionsTwoItem(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 FolderRequestPermissionsItem && equalTo((FolderRequestPermissionsItem) other); + return other instanceof FolderRequestPermissionsTwoItem && equalTo((FolderRequestPermissionsTwoItem) other); } - private boolean equalTo(FolderRequestPermissionsItem other) { + private boolean equalTo(FolderRequestPermissionsTwoItem other) { return value.equals(other.value); } @@ -59,12 +59,12 @@ public String toString() { return this.value.toString(); } - public static FolderRequestPermissionsItem of(String value) { - return new FolderRequestPermissionsItem(value, 0); + public static FolderRequestPermissionsTwoItem of(String value) { + return new FolderRequestPermissionsTwoItem(value, 0); } - public static FolderRequestPermissionsItem of(PermissionRequest value) { - return new FolderRequestPermissionsItem(value, 1); + public static FolderRequestPermissionsTwoItem of(PermissionRequest value) { + return new FolderRequestPermissionsTwoItem(value, 1); } public interface Visitor { @@ -73,13 +73,13 @@ public interface Visitor { T visit(PermissionRequest value); } - static final class Deserializer extends StdDeserializer { + static final class Deserializer extends StdDeserializer { Deserializer() { - super(FolderRequestPermissionsItem.class); + super(FolderRequestPermissionsTwoItem.class); } @java.lang.Override - public FolderRequestPermissionsItem deserialize(JsonParser p, DeserializationContext context) + public FolderRequestPermissionsTwoItem deserialize(JsonParser p, DeserializationContext context) throws IOException { Object value = p.readValueAs(Object.class); try { 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..baffdf245 100644 --- a/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/FoldersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -169,8 +172,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return folders with this name. This performs an exact match. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -193,8 +199,23 @@ public Optional getParentFolderId() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -466,6 +487,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ @@ -508,6 +540,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public FoldersListRequest build() { return new FoldersListRequest( expand, diff --git a/src/main/java/com/merge/api/filestorage/types/Group.java b/src/main/java/com/merge/api/filestorage/types/Group.java index 3413fbbcb..cba18434a 100644 --- a/src/main/java/com/merge/api/filestorage/types/Group.java +++ b/src/main/java/com/merge/api/filestorage/types/Group.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.ArrayList; @@ -79,8 +82,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -103,8 +109,11 @@ public Optional getModifiedAt() { /** * @return The group's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -132,13 +141,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -256,6 +295,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -298,6 +348,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        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.

        */ @@ -361,6 +422,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -372,6 +444,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Group build() { return new Group( id, 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..5114f0813 100644 --- a/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/GroupsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -157,8 +160,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -415,6 +427,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public GroupsListRequest build() { return new GroupsListRequest( expand, diff --git a/src/main/java/com/merge/api/filestorage/types/Issue.java b/src/main/java/com/merge/api/filestorage/types/Issue.java index f7725ed33..7ee85b127 100644 --- a/src/main/java/com/merge/api/filestorage/types/Issue.java +++ b/src/main/java/com/merge/api/filestorage/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..03e5ccb4e 100644 --- a/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

        If provided, will only return issues whose first incident time was before this datetime.

        */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

        If true, will include muted issues

        */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

        If provided, will only return issues whose last incident time was before this datetime.

        */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

        If provided, will only include issues pertaining to the linked account passed in.

        */ diff --git a/src/main/java/com/merge/api/filestorage/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/filestorage/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..f78cc8af6 --- /dev/null +++ b/src/main/java/com/merge/api/filestorage/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} 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..88efc36be 100644 --- a/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
      • filestorage - filestorage
      • *
      */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

      The pagination cursor value.

      */ diff --git a/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java index 7807ea96c..40047e714 100644 --- a/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -72,24 +75,51 @@ public String getData() { *
    • GZIP_BASE64 - GZIP_BASE64
    • *
    */ - @JsonProperty("encoding") + @JsonIgnore public Optional getEncoding() { + if (encoding == null) { + return Optional.empty(); + } return encoding; } /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encoding") + private Optional _getEncoding() { + return encoding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -157,6 +187,8 @@ public interface _FinalStage { _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + _FinalStage encoding(Nullable encoding); + /** *

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

    */ @@ -164,12 +196,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

    The MIME type of the file, if the field is for a file.

    */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +259,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +295,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. @@ -263,6 +331,27 @@ public _FinalStage fileName(Optional fileName) { return this; } + /** + *

    The encoding of the value of data. Defaults to RAW if not defined.

    + *
      + *
    • RAW - RAW
    • + *
    • BASE64 - BASE64
    • + *
    • GZIP_BASE64 - GZIP_BASE64
    • + *
    + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(Nullable encoding) { + if (encoding.isNull()) { + this.encoding = null; + } else if (encoding.isEmpty()) { + this.encoding = Optional.empty(); + } else { + this.encoding = Optional.of(encoding.get()); + } + return this; + } + /** *

    The encoding of the value of data. Defaults to RAW if not defined.

    *
      diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java index 698ea4134..358718658 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java index 90aed02de..e9f72005e 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java index a5bc052ff..480df8c75 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedDownloadRequestMetaList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedDownloadRequestMetaList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java index 9e25c40cc..f1f1633eb 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedDriveList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedDriveList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java index 0b7b17bee..7fce34b70 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedFileList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedFileList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java index 45f5e4569..7577173a8 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedFolderList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedFolderList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java index 60fd62ba8..34cb6b588 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedGroupList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedGroupList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java index 89f80cc5d..2be94ae27 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java index b4097e613..b7783a402 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java b/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java index e8a60f078..54277803f 100644 --- a/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java +++ b/src/main/java/com/merge/api/filestorage/types/PaginatedUserList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedUserList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; 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..a29b5d09f 100644 --- a/src/main/java/com/merge/api/filestorage/types/Permission.java +++ b/src/main/java/com/merge/api/filestorage/types/Permission.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,8 +72,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -93,16 +99,22 @@ public Optional getModifiedAt() { /** * @return The user that is granted this permission. This will only be populated if the type is USER. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } /** * @return The group that is granted this permission. This will only be populated if the type is GROUP. */ - @JsonProperty("group") + @JsonIgnore public Optional getGroup() { + if (group == null) { + return Optional.empty(); + } return group; } @@ -115,16 +127,52 @@ public Optional getGroup() { *
    • ANYONE - ANYONE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return 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. */ - @JsonProperty("roles") + @JsonIgnore public Optional>> getRoles() { + if (roles == null) { + return Optional.empty(); + } + return roles; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + private Optional _getGroup() { + return group; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("roles") + private Optional>> _getRoles() { return roles; } @@ -225,6 +273,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -267,6 +326,17 @@ public Builder user(PermissionUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

    The group that is granted this permission. This will only be populated if the type is GROUP.

    */ @@ -281,6 +351,17 @@ public Builder group(PermissionGroup group) { return this; } + public Builder group(Nullable group) { + if (group.isNull()) { + this.group = null; + } else if (group.isEmpty()) { + this.group = Optional.empty(); + } else { + this.group = Optional.of(group.get()); + } + return this; + } + /** *

    Denotes what type of people have access to the file.

    *
      @@ -301,6 +382,17 @@ public Builder type(PermissionType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

      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.

      */ @@ -315,6 +407,17 @@ public Builder roles(List> roles) { return this; } + public Builder roles(Nullable>> roles) { + if (roles.isNull()) { + this.roles = null; + } else if (roles.isEmpty()) { + this.roles = Optional.empty(); + } else { + this.roles = Optional.of(roles.get()); + } + return this; + } + public Permission build() { return new Permission(id, remoteId, createdAt, modifiedAt, user, group, type, roles, additionalProperties); } diff --git a/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java b/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java index d52f727d8..8d58d266a 100644 --- a/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/PermissionRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -60,24 +63,33 @@ private PermissionRequest( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return The user that is granted this permission. This will only be populated if the type is USER. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } /** * @return The group that is granted this permission. This will only be populated if the type is GROUP. */ - @JsonProperty("group") + @JsonIgnore public Optional getGroup() { + if (group == null) { + return Optional.empty(); + } return group; } @@ -90,26 +102,80 @@ public Optional getGroup() { *
    • ANYONE - ANYONE
    • *
    */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return 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. */ - @JsonProperty("roles") + @JsonIgnore public Optional>> getRoles() { + if (roles == null) { + return Optional.empty(); + } return roles; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("group") + private Optional _getGroup() { + return group; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("roles") + private Optional>> _getRoles() { + return roles; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -201,6 +267,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The user that is granted this permission. This will only be populated if the type is USER.

    */ @@ -215,6 +292,17 @@ public Builder user(PermissionRequestUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

    The group that is granted this permission. This will only be populated if the type is GROUP.

    */ @@ -229,6 +317,17 @@ public Builder group(PermissionRequestGroup group) { return this; } + public Builder group(Nullable group) { + if (group.isNull()) { + this.group = null; + } else if (group.isEmpty()) { + this.group = Optional.empty(); + } else { + this.group = Optional.of(group.get()); + } + return this; + } + /** *

    Denotes what type of people have access to the file.

    *
      @@ -249,6 +348,17 @@ public Builder type(PermissionRequestType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

      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.

      */ @@ -263,6 +373,17 @@ public Builder roles(List> roles) { return this; } + public Builder roles(Nullable>> roles) { + if (roles.isNull()) { + this.roles = null; + } else if (roles.isEmpty()) { + this.roles = Optional.empty(); + } else { + this.roles = Optional.of(roles.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -274,6 +395,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -285,6 +417,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public PermissionRequest build() { return new PermissionRequest( remoteId, user, group, type, roles, integrationParams, linkedAccountParams, 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/RemoteFieldApi.java b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java index 7cb150239..05af7550d 100644 --- a/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/filestorage/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); diff --git a/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java index 3a6a4a302..d79861721 100644 --- a/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/filestorage/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/filestorage/types/User.java b/src/main/java/com/merge/api/filestorage/types/User.java index c355219a5..6f842b40d 100644 --- a/src/main/java/com/merge/api/filestorage/types/User.java +++ b/src/main/java/com/merge/api/filestorage/types/User.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,16 +108,22 @@ public Optional getModifiedAt() { /** * @return The user's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The user's email address. This is typically used to identify a user across linked accounts. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } @@ -131,13 +143,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -255,6 +303,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -297,6 +356,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      The user's email address. This is typically used to identify a user across linked accounts.

      */ @@ -311,6 +381,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

      Whether the user is the one who linked this account.

      */ @@ -350,6 +431,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -361,6 +453,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public User build() { return new User( id, 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..979b3604a 100644 --- a/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/filestorage/types/UsersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -408,6 +420,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public UsersListRequest build() { return new UsersListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/hris/AccountTokenClient.java b/src/main/java/com/merge/api/hris/AccountTokenClient.java index 175aa353b..19b9f3f66 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.AccountTokenRetrieveRequest; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, 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..2dd6b6d2f 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.AccountTokenRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java index f68010daf..db03cf352 100644 --- a/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/AsyncAsyncPassthroughClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveRequest; import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; import com.merge.api.hris.types.DataPassthroughRequest; import java.util.concurrent.CompletableFuture; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java b/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java index ab7d27e47..0735b9b17 100644 --- a/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncEmployeesClient.java @@ -9,9 +9,9 @@ import com.merge.api.hris.types.Employee; import com.merge.api.hris.types.EmployeeEndpointRequest; import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesIgnoreCreateRequest; import com.merge.api.hris.types.EmployeesListRequest; import com.merge.api.hris.types.EmployeesRetrieveRequest; -import com.merge.api.hris.types.IgnoreCommonModelRequest; import com.merge.api.hris.types.MetaResponse; import java.util.concurrent.CompletableFuture; @@ -93,7 +93,7 @@ public CompletableFuture retrieve( /** * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. */ - public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public CompletableFuture ignoreCreate(String modelId, EmployeesIgnoreCreateRequest request) { return this.rawClient.ignoreCreate(modelId, request).thenApply(response -> response.body()); } @@ -101,7 +101,7 @@ public CompletableFuture ignoreCreate(String modelId, IgnoreCommonModelReq * 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. */ public CompletableFuture ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, EmployeesIgnoreCreateRequest request, RequestOptions requestOptions) { return this.rawClient.ignoreCreate(modelId, request, requestOptions).thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java index 7d2b6f848..2dcb824fa 100644 --- a/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/AsyncFieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.hris.types.ExternalTargetFieldApiResponse; import com.merge.api.hris.types.FieldMappingApiInstanceResponse; import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsDestroyRequest; import com.merge.api.hris.types.FieldMappingsRetrieveRequest; import com.merge.api.hris.types.PatchedEditFieldMappingRequest; import com.merge.api.hris.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/hris/AsyncIssuesClient.java b/src/main/java/com/merge/api/hris/AsyncIssuesClient.java index aba84a1c1..de6ddc580 100644 --- a/src/main/java/com/merge/api/hris/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncIssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.hris.types.Issue; import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.IssuesRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncIssuesClient { @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..4eb30a175 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAccountDetailsClient.java @@ -42,7 +42,7 @@ public CompletableFuture> retrieve() { public CompletableFuture> retrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/account-details") + .addPathSegments("account-details") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..fe1878fb6 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.AccountTokenRetrieveRequest; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/account-token") + .addPathSegments("account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..7b16a0dd4 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveRequest; import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; import com.merge.api.hris.types.DataPassthroughRequest; import java.io.IOException; @@ -48,7 +49,7 @@ public CompletableFuture> create( DataPassthroughRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/async-passthrough") + .addPathSegments("async-passthrough") .build(); RequestBody body; try { @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/async-passthrough") + .addPathSegments("async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..2814b9b0a 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture> AuditTrailListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/audit-trail"); + .addPathSegments("audit-trail"); if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..7d29cc579 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawAvailableActionsClient.java @@ -42,7 +42,7 @@ public CompletableFuture> retrieve() { public CompletableFuture> retrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/available-actions") + .addPathSegments("available-actions") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..3e8eea652 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawBankInfoClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> lis BankInfoListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/bank-info"); + .addPathSegments("bank-info"); if (request.getAccountType().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "account_type", request.getAccountType().get(), false); @@ -149,10 +148,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankInfoList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankInfoListRequest nextRequest = BankInfoListRequest.builder() .from(request) .cursor(startingAfter) @@ -160,7 +160,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -172,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)); @@ -213,7 +210,7 @@ public CompletableFuture> retrieve( String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/bank-info") + .addPathSegments("bank-info") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -253,17 +250,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..b683aaf1f 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawBenefitsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> list BenefitsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/benefits"); + .addPathSegments("benefits"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -129,10 +128,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBenefitList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BenefitsListRequest nextRequest = BenefitsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,7 +140,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -152,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)); @@ -193,7 +190,7 @@ public CompletableFuture> retrieve( String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/benefits") + .addPathSegments("benefits") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -225,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(), 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..8a80aa109 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawCompaniesClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> list CompaniesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/companies"); + .addPathSegments("companies"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CompaniesListRequest nextRequest = CompaniesListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,7 +132,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -144,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)); @@ -185,7 +182,7 @@ public CompletableFuture> retrieve( String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/companies") + .addPathSegments("companies") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -213,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(), 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..0b141dcb7 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawDeleteAccountClient.java @@ -42,7 +42,7 @@ public CompletableFuture> delete() { public CompletableFuture> delete(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/delete-account") + .addPathSegments("delete-account") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..c0f3d3beb 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawDependentsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> li DependentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/dependents"); + .addPathSegments("dependents"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedDependentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDependentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DependentsListRequest nextRequest = DependentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -139,7 +139,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -151,12 +151,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)); @@ -192,7 +189,7 @@ public CompletableFuture> retrieve( String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/dependents") + .addPathSegments("dependents") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -227,17 +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(), 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..94442f51f 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeePayrollRunsClient.java @@ -18,7 +18,6 @@ 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; @@ -60,7 +59,7 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedEmployeePayrollRunList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() .from(request) .cursor(startingAfter) @@ -163,7 +163,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -175,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,7 +214,7 @@ public CompletableFuture> retrieve( String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employee-payroll-runs") + .addPathSegments("employee-payroll-runs") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -249,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(), 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..e21b1e63c 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployeesClient.java @@ -16,17 +16,14 @@ import com.merge.api.hris.types.Employee; import com.merge.api.hris.types.EmployeeEndpointRequest; import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesIgnoreCreateRequest; import com.merge.api.hris.types.EmployeesListRequest; import com.merge.api.hris.types.EmployeesRetrieveRequest; -import com.merge.api.hris.types.IgnoreCommonModelRequest; import com.merge.api.hris.types.MetaResponse; 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; import okhttp3.Call; @@ -68,7 +65,7 @@ public CompletableFuture>> lis EmployeesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees"); + .addPathSegments("employees"); if (request.getCompanyId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "company_id", request.getCompanyId().get(), false); @@ -225,10 +222,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) .cursor(startingAfter) @@ -236,7 +234,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -248,12 +246,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)); @@ -282,7 +277,7 @@ public CompletableFuture> create( EmployeeEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees"); + .addPathSegments("employees"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -291,12 +286,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 +309,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)); @@ -363,7 +354,7 @@ public CompletableFuture> retrieve( String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees") + .addPathSegments("employees") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -410,17 +401,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)); @@ -439,7 +428,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request) { + String modelId, EmployeesIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -447,16 +436,16 @@ public CompletableFuture> ignoreCreate( * 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. */ public CompletableFuture> ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, EmployeesIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees/ignore") + .addPathSegments("employees/ignore") .addPathSegment(modelId) .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize request", e); } @@ -480,11 +469,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)); @@ -512,7 +499,7 @@ public CompletableFuture> metaPostRetrieve() public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees/meta/post") + .addPathSegments("employees/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -529,18 +516,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..1d9c1b776 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmployerBenefitsClient.java @@ -18,7 +18,6 @@ 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; @@ -60,7 +59,7 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedEmployerBenefitList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() .from(request) .cursor(startingAfter) @@ -134,7 +134,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -146,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)); @@ -188,7 +185,7 @@ public CompletableFuture> retrieve( String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employer-benefits") + .addPathSegments("employer-benefits") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -216,18 +213,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..a3cb21fd2 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawEmploymentsClient.java @@ -18,7 +18,6 @@ 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; @@ -60,7 +59,7 @@ public CompletableFuture>> l EmploymentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employments"); + .addPathSegments("employments"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -142,10 +141,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedEmploymentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmploymentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmploymentsListRequest nextRequest = EmploymentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -153,7 +153,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -165,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)); @@ -206,7 +203,7 @@ public CompletableFuture> retrieve( String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employments") + .addPathSegments("employments") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -246,18 +243,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..28b1339bb 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.hris.types.ExternalTargetFieldApiResponse; import com.merge.api.hris.types.FieldMappingApiInstanceResponse; import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsDestroyRequest; import com.merge.api.hris.types.FieldMappingsRetrieveRequest; import com.merge.api.hris.types.PatchedEditFieldMappingRequest; 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; @@ -64,7 +63,7 @@ public CompletableFuture> FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings"); + .addPathSegments("field-mappings"); if (request.getExcludeRemoteFieldMetadata().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -87,19 +86,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)); @@ -129,7 +126,7 @@ public CompletableFuture> fie CreateFieldMappingRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings"); + .addPathSegments("field-mappings"); if (request.getExcludeRemoteFieldMetadata().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -137,17 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings") + .addPathSegments("field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -278,7 +273,7 @@ public CompletableFuture> fie String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings") + .addPathSegments("field-mappings") .addPathSegment(fieldMappingId) .build(); RequestBody body; @@ -304,19 +299,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)); @@ -353,7 +346,7 @@ public CompletableFuture> remoteFie RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/remote-fields"); + .addPathSegments("remote-fields"); if (request.getCommonModels().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "common_models", request.getCommonModels().get(), false); @@ -380,19 +373,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)); @@ -421,7 +411,7 @@ public CompletableFuture> t RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/target-fields") + .addPathSegments("target-fields") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -438,19 +428,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..6d1d541c9 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawForceResyncClient.java @@ -46,7 +46,7 @@ public CompletableFuture>> syncStatusResyn RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/sync-status/resync") + .addPathSegments("sync-status/resync") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..e44187101 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawGenerateKeyClient.java @@ -47,7 +47,7 @@ public CompletableFuture> create( GenerateRemoteKeyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/generate-key") + .addPathSegments("generate-key") .build(); RequestBody body; try { @@ -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..d1a2f0bf3 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> list( GroupsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/groups"); + .addPathSegments("groups"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -144,17 +143,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -166,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)); @@ -207,7 +204,7 @@ public CompletableFuture> retrieve( String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/groups") + .addPathSegments("groups") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -243,17 +240,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/hris/AsyncRawIssuesClient.java b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java index f7e148be1..b065e4337 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.hris.types.Issue; import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.IssuesRetrieveRequest; import com.merge.api.hris.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; @@ -58,7 +58,7 @@ public CompletableFuture>> list( IssuesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/issues"); + .addPathSegments("issues"); if (request.getAccountToken().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "account_token", request.getAccountToken().get(), false); @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/issues") + .addPathSegments("issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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..e96a154b6 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkTokenClient.java @@ -47,7 +47,7 @@ public CompletableFuture> create( EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/link-token") + .addPathSegments("link-token") .build(); RequestBody body; try { @@ -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..ce4dcd558 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); diff --git a/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java index e5ab7a389..2ea6a00d5 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawLocationsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> lis LocationsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/locations"); + .addPathSegments("locations"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -133,10 +132,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLocationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LocationsListRequest nextRequest = LocationsListRequest.builder() .from(request) .cursor(startingAfter) @@ -144,7 +144,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -156,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)); @@ -197,7 +194,7 @@ public CompletableFuture> retrieve( String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/locations") + .addPathSegments("locations") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -233,17 +230,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..dc66db0d6 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPassthroughClient.java @@ -47,7 +47,7 @@ public CompletableFuture> create( DataPassthroughRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/passthrough") + .addPathSegments("passthrough") .build(); RequestBody body; try { @@ -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..70e2c4c11 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPayGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> lis PayGroupsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/pay-groups"); + .addPathSegments("pay-groups"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,7 +132,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -144,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)); @@ -185,7 +182,7 @@ public CompletableFuture> retrieve( String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/pay-groups") + .addPathSegments("pay-groups") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -213,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(), 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..8978683d2 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawPayrollRunsClient.java @@ -18,7 +18,6 @@ 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; @@ -60,7 +59,7 @@ public CompletableFuture>> l PayrollRunsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/payroll-runs"); + .addPathSegments("payroll-runs"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -150,10 +149,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedPayrollRunList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayrollRunList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PayrollRunsListRequest nextRequest = PayrollRunsListRequest.builder() .from(request) .cursor(startingAfter) @@ -161,7 +161,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -173,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)); @@ -214,7 +211,7 @@ public CompletableFuture> retrieve( String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/payroll-runs") + .addPathSegments("payroll-runs") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -250,18 +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(), 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..663b1044e 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawRegenerateKeyClient.java @@ -47,7 +47,7 @@ public CompletableFuture> create( RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/regenerate-key") + .addPathSegments("regenerate-key") .build(); RequestBody body; try { @@ -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..094fe14d0 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawScopesClient.java @@ -47,7 +47,7 @@ public CompletableFuture> defaultScope RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/default-scopes") + .addPathSegments("default-scopes") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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)); @@ -104,7 +102,7 @@ public CompletableFuture> linkedAccoun RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") + .addPathSegments("linked-account-scopes") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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)); @@ -162,7 +158,7 @@ public CompletableFuture> linkedAccoun LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") + .addPathSegments("linked-account-scopes") .build(); RequestBody body; try { @@ -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..aeb517dfa 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -58,7 +57,7 @@ public CompletableFuture>> l SyncStatusListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/sync-status"); + .addPathSegments("sync-status"); if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -82,10 +81,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) .cursor(startingAfter) @@ -93,7 +93,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -105,12 +105,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..176f1675b 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTeamsClient.java @@ -18,7 +18,6 @@ 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; @@ -59,7 +58,7 @@ public CompletableFuture>> list( TeamsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/teams"); + .addPathSegments("teams"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -129,17 +128,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -151,12 +151,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)); @@ -192,7 +189,7 @@ public CompletableFuture> retrieve( String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/teams") + .addPathSegments("teams") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -224,17 +221,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..e77850b0b 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffBalancesClient.java @@ -18,7 +18,6 @@ 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; @@ -60,7 +59,7 @@ public CompletableFuture TimeOffBalancesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off-balances"); + .addPathSegments("time-off-balances"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -142,10 +141,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedTimeOffBalanceList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() .from(request) .cursor(startingAfter) @@ -154,7 +154,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -166,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)); @@ -208,7 +205,7 @@ public CompletableFuture> retrieve( String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off-balances") + .addPathSegments("time-off-balances") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -248,18 +245,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..e2e9600dd 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimeOffClient.java @@ -21,10 +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; import okhttp3.Call; @@ -66,7 +63,7 @@ public CompletableFuture>> list TimeOffListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off"); + .addPathSegments("time-off"); if (request.getApproverId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "approver_id", request.getApproverId().get(), false); @@ -172,10 +169,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimeOffListRequest nextRequest = TimeOffListRequest.builder() .from(request) .cursor(startingAfter) @@ -183,7 +181,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -195,12 +193,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,7 +224,7 @@ public CompletableFuture> create( TimeOffEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off"); + .addPathSegments("time-off"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -238,12 +233,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 +256,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)); @@ -310,7 +301,7 @@ public CompletableFuture> retrieve( String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off") + .addPathSegments("time-off") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -350,17 +341,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)); @@ -388,7 +377,7 @@ public CompletableFuture> metaPostRetrieve() public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off/meta/post") + .addPathSegments("time-off/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -405,18 +394,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..1e8f1ba78 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawTimesheetEntriesClient.java @@ -21,10 +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; import okhttp3.Call; @@ -67,7 +64,7 @@ public CompletableFuture TimesheetEntriesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); + .addPathSegments("timesheet-entries"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -157,10 +154,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedTimesheetEntryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -169,7 +167,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -181,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)); @@ -216,7 +211,7 @@ public CompletableFuture> create( TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); + .addPathSegments("timesheet-entries"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -225,12 +220,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 +243,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)); @@ -299,7 +289,7 @@ public CompletableFuture> retrieve( String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries") + .addPathSegments("timesheet-entries") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -331,18 +321,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)); @@ -370,7 +358,7 @@ public CompletableFuture> metaPostRetrieve() public CompletableFuture> metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries/meta/post") + .addPathSegments("timesheet-entries/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -387,18 +375,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..ec86f4479 100644 --- a/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/hris/AsyncRawWebhookReceiversClient.java @@ -48,7 +48,7 @@ public CompletableFuture>> list() { public CompletableFuture>> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") + .addPathSegments("webhook-receivers") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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)); @@ -106,7 +104,7 @@ public CompletableFuture> create( WebhookReceiverRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") + .addPathSegments("webhook-receivers") .build(); RequestBody body; try { @@ -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/EmployeesClient.java b/src/main/java/com/merge/api/hris/EmployeesClient.java index a94c539f0..b7589c010 100644 --- a/src/main/java/com/merge/api/hris/EmployeesClient.java +++ b/src/main/java/com/merge/api/hris/EmployeesClient.java @@ -9,9 +9,9 @@ import com.merge.api.hris.types.Employee; import com.merge.api.hris.types.EmployeeEndpointRequest; import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesIgnoreCreateRequest; import com.merge.api.hris.types.EmployeesListRequest; import com.merge.api.hris.types.EmployeesRetrieveRequest; -import com.merge.api.hris.types.IgnoreCommonModelRequest; import com.merge.api.hris.types.MetaResponse; public class EmployeesClient { @@ -90,14 +90,14 @@ public Employee retrieve(String id, EmployeesRetrieveRequest request, RequestOpt /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public void ignoreCreate(String modelId, EmployeesIgnoreCreateRequest request) { this.rawClient.ignoreCreate(modelId, request).body(); } /** * 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. */ - public void ignoreCreate(String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + public void ignoreCreate(String modelId, EmployeesIgnoreCreateRequest request, RequestOptions requestOptions) { this.rawClient.ignoreCreate(modelId, request, requestOptions).body(); } diff --git a/src/main/java/com/merge/api/hris/FieldMappingClient.java b/src/main/java/com/merge/api/hris/FieldMappingClient.java index 0af1275d6..1888c62c0 100644 --- a/src/main/java/com/merge/api/hris/FieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/FieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.hris.types.ExternalTargetFieldApiResponse; import com.merge.api.hris.types.FieldMappingApiInstanceResponse; import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsDestroyRequest; import com.merge.api.hris.types.FieldMappingsRetrieveRequest; import com.merge.api.hris.types.PatchedEditFieldMappingRequest; import com.merge.api.hris.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/hris/IssuesClient.java b/src/main/java/com/merge/api/hris/IssuesClient.java index 90efe089a..fbf1ed673 100644 --- a/src/main/java/com/merge/api/hris/IssuesClient.java +++ b/src/main/java/com/merge/api/hris/IssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.hris.types.Issue; import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.IssuesRetrieveRequest; public class IssuesClient { protected final ClientOptions clientOptions; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..6e3c61286 100644 --- a/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java +++ b/src/main/java/com/merge/api/hris/RawAccountDetailsClient.java @@ -38,7 +38,7 @@ public MergeApiHttpResponse retrieve() { public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/account-details") + .addPathSegments("account-details") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..1bdfd8bfe 100644 --- a/src/main/java/com/merge/api/hris/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/hris/RawAccountTokenClient.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.AccountTokenRetrieveRequest; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/account-token") + .addPathSegments("account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..28d630aca 100644 --- a/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/RawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.hris.types.AsyncPassthroughReciept; +import com.merge.api.hris.types.AsyncPassthroughRetrieveRequest; import com.merge.api.hris.types.AsyncPassthroughRetrieveResponse; import com.merge.api.hris.types.DataPassthroughRequest; import java.io.IOException; @@ -44,7 +45,7 @@ public MergeApiHttpResponse create( DataPassthroughRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/async-passthrough") + .addPathSegments("async-passthrough") .build(); RequestBody body; try { @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/async-passthrough") + .addPathSegments("async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..128864c44 100644 --- a/src/main/java/com/merge/api/hris/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/hris/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -53,7 +52,7 @@ public MergeApiHttpResponse> list( AuditTrailListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/audit-trail"); + .addPathSegments("audit-trail"); if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/hris/RawAvailableActionsClient.java b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java index 43bd22aed..85f122142 100644 --- a/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java +++ b/src/main/java/com/merge/api/hris/RawAvailableActionsClient.java @@ -38,7 +38,7 @@ public MergeApiHttpResponse retrieve() { public MergeApiHttpResponse retrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/available-actions") + .addPathSegments("available-actions") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..5a5dd3010 100644 --- a/src/main/java/com/merge/api/hris/RawBankInfoClient.java +++ b/src/main/java/com/merge/api/hris/RawBankInfoClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( BankInfoListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/bank-info"); + .addPathSegments("bank-info"); if (request.getAccountType().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "account_type", request.getAccountType().get(), false); @@ -141,27 +140,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBankInfoList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BankInfoListRequest nextRequest = BankInfoListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -188,7 +184,7 @@ public MergeApiHttpResponse retrieve( String id, BankInfoRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/bank-info") + .addPathSegments("bank-info") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -225,16 +221,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..dbd9b7722 100644 --- a/src/main/java/com/merge/api/hris/RawBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/RawBenefitsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( BenefitsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/benefits"); + .addPathSegments("benefits"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -121,27 +120,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedBenefitList.class); + String startingAfter = parsedResponse.getNext().orElse(null); BenefitsListRequest nextRequest = BenefitsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -168,7 +164,7 @@ public MergeApiHttpResponse retrieve( String id, BenefitsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/benefits") + .addPathSegments("benefits") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -197,16 +193,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..efce634e4 100644 --- a/src/main/java/com/merge/api/hris/RawCompaniesClient.java +++ b/src/main/java/com/merge/api/hris/RawCompaniesClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( CompaniesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/companies"); + .addPathSegments("companies"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCompanyList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CompaniesListRequest nextRequest = CompaniesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -160,7 +156,7 @@ public MergeApiHttpResponse retrieve( String id, CompaniesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/companies") + .addPathSegments("companies") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -185,16 +181,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..ebcae1869 100644 --- a/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java +++ b/src/main/java/com/merge/api/hris/RawDeleteAccountClient.java @@ -38,7 +38,7 @@ public MergeApiHttpResponse delete() { public MergeApiHttpResponse delete(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/delete-account") + .addPathSegments("delete-account") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..5c77e9f9a 100644 --- a/src/main/java/com/merge/api/hris/RawDependentsClient.java +++ b/src/main/java/com/merge/api/hris/RawDependentsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( DependentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/dependents"); + .addPathSegments("dependents"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -120,27 +119,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedDependentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); DependentsListRequest nextRequest = DependentsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,7 +163,7 @@ public MergeApiHttpResponse retrieve( String id, DependentsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/dependents") + .addPathSegments("dependents") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -199,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(), 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..191b67c1b 100644 --- a/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployeePayrollRunsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( EmployeePayrollRunsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employee-payroll-runs"); + .addPathSegments("employee-payroll-runs"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -141,10 +140,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedEmployeePayrollRunList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeePayrollRunList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeePayrollRunsListRequest nextRequest = EmployeePayrollRunsListRequest.builder() .from(request) .cursor(startingAfter) @@ -152,17 +152,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -189,7 +185,7 @@ public MergeApiHttpResponse retrieve( String id, EmployeePayrollRunsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employee-payroll-runs") + .addPathSegments("employee-payroll-runs") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -218,16 +214,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..dceec4877 100644 --- a/src/main/java/com/merge/api/hris/RawEmployeesClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployeesClient.java @@ -16,17 +16,14 @@ import com.merge.api.hris.types.Employee; import com.merge.api.hris.types.EmployeeEndpointRequest; import com.merge.api.hris.types.EmployeeResponse; +import com.merge.api.hris.types.EmployeesIgnoreCreateRequest; import com.merge.api.hris.types.EmployeesListRequest; import com.merge.api.hris.types.EmployeesRetrieveRequest; -import com.merge.api.hris.types.IgnoreCommonModelRequest; import com.merge.api.hris.types.MetaResponse; 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; import okhttp3.OkHttpClient; @@ -63,7 +60,7 @@ public MergeApiHttpResponse> list( EmployeesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees"); + .addPathSegments("employees"); if (request.getCompanyId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "company_id", request.getCompanyId().get(), false); @@ -217,27 +214,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployeeList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployeesListRequest nextRequest = EmployeesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -257,7 +251,7 @@ public MergeApiHttpResponse create( EmployeeEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees"); + .addPathSegments("employees"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -266,12 +260,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 +280,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); } @@ -324,7 +313,7 @@ public MergeApiHttpResponse retrieve( String id, EmployeesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees") + .addPathSegments("employees") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -368,16 +357,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); } @@ -386,7 +372,7 @@ public MergeApiHttpResponse retrieve( /** * Ignores a specific row based on the model_id in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. */ - public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModelRequest request) { + public MergeApiHttpResponse ignoreCreate(String modelId, EmployeesIgnoreCreateRequest request) { return ignoreCreate(modelId, request, null); } @@ -394,16 +380,16 @@ public MergeApiHttpResponse ignoreCreate(String modelId, IgnoreCommonModel * 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. */ public MergeApiHttpResponse ignoreCreate( - String modelId, IgnoreCommonModelRequest request, RequestOptions requestOptions) { + String modelId, EmployeesIgnoreCreateRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees/ignore") + .addPathSegments("employees/ignore") .addPathSegment(modelId) .build(); RequestBody body; try { body = RequestBody.create( - ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request.getBody()), MediaTypes.APPLICATION_JSON); } catch (JsonProcessingException e) { throw new MergeException("Failed to serialize request", e); } @@ -423,11 +409,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,7 +429,7 @@ public MergeApiHttpResponse metaPostRetrieve() { public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employees/meta/post") + .addPathSegments("employees/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -460,16 +443,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..09af8a545 100644 --- a/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmployerBenefitsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( EmployerBenefitsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employer-benefits"); + .addPathSegments("employer-benefits"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -113,10 +112,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmployerBenefitList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmployerBenefitsListRequest nextRequest = EmployerBenefitsListRequest.builder() .from(request) .cursor(startingAfter) @@ -124,17 +124,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -161,7 +157,7 @@ public MergeApiHttpResponse retrieve( String id, EmployerBenefitsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employer-benefits") + .addPathSegments("employer-benefits") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -186,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(), 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..8dd2de8d2 100644 --- a/src/main/java/com/merge/api/hris/RawEmploymentsClient.java +++ b/src/main/java/com/merge/api/hris/RawEmploymentsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( EmploymentsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employments"); + .addPathSegments("employments"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -133,28 +132,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedEmploymentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); EmploymentsListRequest nextRequest = EmploymentsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -181,7 +176,7 @@ public MergeApiHttpResponse retrieve( String id, EmploymentsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/employments") + .addPathSegments("employments") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -218,16 +213,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..4ff34ceb9 100644 --- a/src/main/java/com/merge/api/hris/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/hris/RawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.hris.types.ExternalTargetFieldApiResponse; import com.merge.api.hris.types.FieldMappingApiInstanceResponse; import com.merge.api.hris.types.FieldMappingInstanceResponse; +import com.merge.api.hris.types.FieldMappingsDestroyRequest; import com.merge.api.hris.types.FieldMappingsRetrieveRequest; import com.merge.api.hris.types.PatchedEditFieldMappingRequest; 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; @@ -60,7 +59,7 @@ public MergeApiHttpResponse fieldMappingsRetrie FieldMappingsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings"); + .addPathSegments("field-mappings"); if (request.getExcludeRemoteFieldMetadata().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -80,18 +79,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); } @@ -111,7 +106,7 @@ public MergeApiHttpResponse fieldMappingsCreate( CreateFieldMappingRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings"); + .addPathSegments("field-mappings"); if (request.getExcludeRemoteFieldMetadata().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, @@ -119,17 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings") + .addPathSegments("field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -230,7 +221,7 @@ public MergeApiHttpResponse fieldMappingsPartialUp String fieldMappingId, PatchedEditFieldMappingRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/field-mappings") + .addPathSegments("field-mappings") .addPathSegment(fieldMappingId) .build(); RequestBody body; @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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); } @@ -290,7 +278,7 @@ public MergeApiHttpResponse remoteFieldsRetrieve( RemoteFieldsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/remote-fields"); + .addPathSegments("remote-fields"); if (request.getCommonModels().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "common_models", request.getCommonModels().get(), false); @@ -314,17 +302,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); } @@ -343,7 +328,7 @@ public MergeApiHttpResponse targetFieldsRetrieve public MergeApiHttpResponse targetFieldsRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/target-fields") + .addPathSegments("target-fields") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -357,18 +342,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..d906eaefa 100644 --- a/src/main/java/com/merge/api/hris/RawForceResyncClient.java +++ b/src/main/java/com/merge/api/hris/RawForceResyncClient.java @@ -41,7 +41,7 @@ public MergeApiHttpResponse> syncStatusResyncCreate() { public MergeApiHttpResponse> syncStatusResyncCreate(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/sync-status/resync") + .addPathSegments("sync-status/resync") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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..3b6d16da1 100644 --- a/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/RawGenerateKeyClient.java @@ -42,7 +42,7 @@ public MergeApiHttpResponse create(GenerateRemoteKeyRequest request) public MergeApiHttpResponse create(GenerateRemoteKeyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/generate-key") + .addPathSegments("generate-key") .build(); RequestBody body; try { @@ -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..d41da8c65 100644 --- a/src/main/java/com/merge/api/hris/RawGroupsClient.java +++ b/src/main/java/com/merge/api/hris/RawGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( GroupsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/groups"); + .addPathSegments("groups"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -136,27 +135,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -183,7 +179,7 @@ public MergeApiHttpResponse retrieve( String id, GroupsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/groups") + .addPathSegments("groups") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -216,16 +212,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/hris/RawIssuesClient.java b/src/main/java/com/merge/api/hris/RawIssuesClient.java index 1c753f97f..a4726196b 100644 --- a/src/main/java/com/merge/api/hris/RawIssuesClient.java +++ b/src/main/java/com/merge/api/hris/RawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.hris.types.Issue; import com.merge.api.hris.types.IssuesListRequest; +import com.merge.api.hris.types.IssuesRetrieveRequest; import com.merge.api.hris.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; @@ -53,7 +53,7 @@ public MergeApiHttpResponse> list( IssuesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/issues"); + .addPathSegments("issues"); if (request.getAccountToken().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "account_token", request.getAccountToken().get(), false); @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/issues") + .addPathSegments("issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..162a8ee8a 100644 --- a/src/main/java/com/merge/api/hris/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/hris/RawLinkTokenClient.java @@ -42,7 +42,7 @@ public MergeApiHttpResponse create(EndUserDetailsRequest request) { public MergeApiHttpResponse create(EndUserDetailsRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/link-token") + .addPathSegments("link-token") .build(); RequestBody body; try { @@ -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..a4c9d1204 100644 --- a/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/hris/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -53,7 +52,7 @@ public MergeApiHttpResponse> list( LinkedAccountsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/linked-accounts"); + .addPathSegments("linked-accounts"); if (request.getCategory().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "category", request.getCategory().get(), false); @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/hris/RawLocationsClient.java b/src/main/java/com/merge/api/hris/RawLocationsClient.java index 08ac35f54..051670fce 100644 --- a/src/main/java/com/merge/api/hris/RawLocationsClient.java +++ b/src/main/java/com/merge/api/hris/RawLocationsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( LocationsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/locations"); + .addPathSegments("locations"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -125,27 +124,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedLocationList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LocationsListRequest nextRequest = LocationsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -172,7 +168,7 @@ public MergeApiHttpResponse retrieve( String id, LocationsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/locations") + .addPathSegments("locations") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -205,16 +201,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..792a6d0f9 100644 --- a/src/main/java/com/merge/api/hris/RawPassthroughClient.java +++ b/src/main/java/com/merge/api/hris/RawPassthroughClient.java @@ -42,7 +42,7 @@ public MergeApiHttpResponse create(DataPassthroughRequest reques public MergeApiHttpResponse create(DataPassthroughRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/passthrough") + .addPathSegments("passthrough") .build(); RequestBody body; try { @@ -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..404ccc6a6 100644 --- a/src/main/java/com/merge/api/hris/RawPayGroupsClient.java +++ b/src/main/java/com/merge/api/hris/RawPayGroupsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( PayGroupsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/pay-groups"); + .addPathSegments("pay-groups"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayGroupList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PayGroupsListRequest nextRequest = PayGroupsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -160,7 +156,7 @@ public MergeApiHttpResponse retrieve( String id, PayGroupsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/pay-groups") + .addPathSegments("pay-groups") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -185,16 +181,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..70e46cfad 100644 --- a/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java +++ b/src/main/java/com/merge/api/hris/RawPayrollRunsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( PayrollRunsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/payroll-runs"); + .addPathSegments("payroll-runs"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -141,28 +140,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedPayrollRunList.class); + String startingAfter = parsedResponse.getNext().orElse(null); PayrollRunsListRequest nextRequest = PayrollRunsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -189,7 +184,7 @@ public MergeApiHttpResponse retrieve( String id, PayrollRunsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/payroll-runs") + .addPathSegments("payroll-runs") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -222,16 +217,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..1a24cdd10 100644 --- a/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java +++ b/src/main/java/com/merge/api/hris/RawRegenerateKeyClient.java @@ -43,7 +43,7 @@ public MergeApiHttpResponse create( RemoteKeyForRegenerationRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/regenerate-key") + .addPathSegments("regenerate-key") .build(); RequestBody body; try { @@ -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..dee8586ef 100644 --- a/src/main/java/com/merge/api/hris/RawScopesClient.java +++ b/src/main/java/com/merge/api/hris/RawScopesClient.java @@ -42,7 +42,7 @@ public MergeApiHttpResponse defaultScopesRetrieve() { public MergeApiHttpResponse defaultScopesRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/default-scopes") + .addPathSegments("default-scopes") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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); } @@ -85,7 +81,7 @@ public MergeApiHttpResponse linkedAccountScopesRetrieve() { public MergeApiHttpResponse linkedAccountScopesRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") + .addPathSegments("linked-account-scopes") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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); } @@ -130,7 +122,7 @@ public MergeApiHttpResponse linkedAccountScopesCreate( LinkedAccountCommonModelScopeDeserializerRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/linked-account-scopes") + .addPathSegments("linked-account-scopes") .build(); RequestBody body; try { @@ -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..3bc5a26ea 100644 --- a/src/main/java/com/merge/api/hris/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/hris/RawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -53,7 +52,7 @@ public MergeApiHttpResponse> list( SyncStatusListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/sync-status"); + .addPathSegments("sync-status"); if (request.getCursor().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "cursor", request.getCursor().get(), false); @@ -74,28 +73,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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/hris/RawTeamsClient.java b/src/main/java/com/merge/api/hris/RawTeamsClient.java index ab0c4c26a..0edbb3012 100644 --- a/src/main/java/com/merge/api/hris/RawTeamsClient.java +++ b/src/main/java/com/merge/api/hris/RawTeamsClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( TeamsListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/teams"); + .addPathSegments("teams"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -121,27 +120,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,7 +163,7 @@ public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest reque public MergeApiHttpResponse retrieve(String id, TeamsRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/teams") + .addPathSegments("teams") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -196,16 +192,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..001fd9944 100644 --- a/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java +++ b/src/main/java/com/merge/api/hris/RawTimeOffBalancesClient.java @@ -18,7 +18,6 @@ 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; @@ -54,7 +53,7 @@ public MergeApiHttpResponse> list( TimeOffBalancesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off-balances"); + .addPathSegments("time-off-balances"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -133,10 +132,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffBalanceList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimeOffBalancesListRequest nextRequest = TimeOffBalancesListRequest.builder() .from(request) .cursor(startingAfter) @@ -144,17 +144,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -181,7 +177,7 @@ public MergeApiHttpResponse retrieve( String id, TimeOffBalancesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off-balances") + .addPathSegments("time-off-balances") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -218,16 +214,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..4ecc59a9c 100644 --- a/src/main/java/com/merge/api/hris/RawTimeOffClient.java +++ b/src/main/java/com/merge/api/hris/RawTimeOffClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -61,7 +58,7 @@ public MergeApiHttpResponse> list( TimeOffListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off"); + .addPathSegments("time-off"); if (request.getApproverId().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "approver_id", request.getApproverId().get(), false); @@ -164,27 +161,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimeOffList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimeOffListRequest nextRequest = TimeOffListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -203,7 +197,7 @@ public MergeApiHttpResponse create(TimeOffEndpointRequest reque public MergeApiHttpResponse create(TimeOffEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off"); + .addPathSegments("time-off"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -212,12 +206,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 +226,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); } @@ -270,7 +259,7 @@ public MergeApiHttpResponse retrieve( String id, TimeOffRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off") + .addPathSegments("time-off") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -307,16 +296,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); } @@ -335,7 +321,7 @@ public MergeApiHttpResponse metaPostRetrieve() { public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/time-off/meta/post") + .addPathSegments("time-off/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -349,16 +335,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..a0c11d890 100644 --- a/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java +++ b/src/main/java/com/merge/api/hris/RawTimesheetEntriesClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -61,7 +58,7 @@ public MergeApiHttpResponse> list( TimesheetEntriesListRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); + .addPathSegments("timesheet-entries"); if (request.getCreatedAfter().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "created_after", request.getCreatedAfter().get(), false); @@ -148,10 +145,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTimesheetEntryList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TimesheetEntriesListRequest nextRequest = TimesheetEntriesListRequest.builder() .from(request) .cursor(startingAfter) @@ -159,17 +157,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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); } @@ -189,7 +183,7 @@ public MergeApiHttpResponse create( TimesheetEntryEndpointRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries"); + .addPathSegments("timesheet-entries"); if (request.getIsDebugMode().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "is_debug_mode", request.getIsDebugMode().get(), false); @@ -198,12 +192,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 +212,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); } @@ -257,7 +246,7 @@ public MergeApiHttpResponse retrieve( String id, TimesheetEntriesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries") + .addPathSegments("timesheet-entries") .addPathSegment(id); if (request.getIncludeRemoteData().isPresent()) { QueryStringMapper.addQueryParameter( @@ -286,16 +275,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); } @@ -314,7 +300,7 @@ public MergeApiHttpResponse metaPostRetrieve() { public MergeApiHttpResponse metaPostRetrieve(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/timesheet-entries/meta/post") + .addPathSegments("timesheet-entries/meta/post") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -328,16 +314,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..aa8e139af 100644 --- a/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java +++ b/src/main/java/com/merge/api/hris/RawWebhookReceiversClient.java @@ -44,7 +44,7 @@ public MergeApiHttpResponse> list() { public MergeApiHttpResponse> list(RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") + .addPathSegments("webhook-receivers") .build(); Request okhttpRequest = new Request.Builder() .url(httpUrl) @@ -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); } @@ -88,7 +85,7 @@ public MergeApiHttpResponse create(WebhookReceiverRequest reque public MergeApiHttpResponse create(WebhookReceiverRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() - .addPathSegments("hris/v1/webhook-receivers") + .addPathSegments("webhook-receivers") .build(); RequestBody body; try { @@ -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..dc749c0f5 100644 --- a/src/main/java/com/merge/api/hris/types/AccountDetails.java +++ b/src/main/java/com/merge/api/hris/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(AccountDetailsCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..b1408e8d4 100644 --- a/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/hris/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/AccountIntegration.java b/src/main/java/com/merge/api/hris/types/AccountIntegration.java index 85449794d..1eac095b6 100644 --- a/src/main/java/com/merge/api/hris/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/hris/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

      Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

      */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

      Company logo in square shape.

      */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

      The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

      */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

      Category or categories this integration is in beta status for.

      */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

      Company logo in square shape.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

      Company logo in rectangular shape.

      * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..bd40b0ae5 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..39c24a770 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(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..9fa023088 100644 --- a/src/main/java/com/merge/api/hris/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/hris/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

      The User's email at the time of this Event occurring.

      */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/BankInfo.java b/src/main/java/com/merge/api/hris/types/BankInfo.java index 6659f8e5d..51ca3a39a 100644 --- a/src/main/java/com/merge/api/hris/types/BankInfo.java +++ b/src/main/java/com/merge/api/hris/types/BankInfo.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,32 +120,44 @@ public Optional getModifiedAt() { /** * @return The employee with this bank account. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The account number. */ - @JsonProperty("account_number") + @JsonIgnore public Optional getAccountNumber() { + if (accountNumber == null) { + return Optional.empty(); + } return accountNumber; } /** * @return The routing number. */ - @JsonProperty("routing_number") + @JsonIgnore public Optional getRoutingNumber() { + if (routingNumber == null) { + return Optional.empty(); + } return routingNumber; } /** * @return The bank name. */ - @JsonProperty("bank_name") + @JsonIgnore public Optional getBankName() { + if (bankName == null) { + return Optional.empty(); + } return bankName; } @@ -150,16 +168,22 @@ public Optional getBankName() { *
    • CHECKING - CHECKING
    • *
    */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } /** * @return When the matching bank object was created in the third party system. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -171,13 +195,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_number") + private Optional _getAccountNumber() { + return accountNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("routing_number") + private Optional _getRoutingNumber() { + return routingNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bank_name") + private Optional _getBankName() { + return bankName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -310,6 +394,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -352,6 +447,17 @@ public Builder employee(BankInfoEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The account number.

    */ @@ -366,6 +472,17 @@ public Builder accountNumber(String accountNumber) { return this; } + public Builder accountNumber(Nullable accountNumber) { + if (accountNumber.isNull()) { + this.accountNumber = null; + } else if (accountNumber.isEmpty()) { + this.accountNumber = Optional.empty(); + } else { + this.accountNumber = Optional.of(accountNumber.get()); + } + return this; + } + /** *

    The routing number.

    */ @@ -380,6 +497,17 @@ public Builder routingNumber(String routingNumber) { return this; } + public Builder routingNumber(Nullable routingNumber) { + if (routingNumber.isNull()) { + this.routingNumber = null; + } else if (routingNumber.isEmpty()) { + this.routingNumber = Optional.empty(); + } else { + this.routingNumber = Optional.of(routingNumber.get()); + } + return this; + } + /** *

    The bank name.

    */ @@ -394,6 +522,17 @@ public Builder bankName(String bankName) { return this; } + public Builder bankName(Nullable bankName) { + if (bankName.isNull()) { + this.bankName = null; + } else if (bankName.isEmpty()) { + this.bankName = Optional.empty(); + } else { + this.bankName = Optional.of(bankName.get()); + } + return this; + } + /** *

    The bank account type

    *
      @@ -412,6 +551,17 @@ public Builder accountType(BankInfoAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + return this; + } + /** *

      When the matching bank object was created in the third party system.

      */ @@ -426,6 +576,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

      */ @@ -451,6 +612,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -462,6 +634,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public BankInfo build() { return new BankInfo( id, 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..aeb8e69ab 100644 --- a/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankInfoListRequest.Builder.class) public final class BankInfoListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional accountType; @@ -51,16 +54,16 @@ public final class BankInfoListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private BankInfoListRequest( - Optional> expand, + Optional> expand, Optional accountType, Optional bankName, Optional createdAfter, @@ -74,9 +77,9 @@ private BankInfoListRequest( Optional modifiedBefore, Optional orderBy, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.accountType = accountType; @@ -102,7 +105,7 @@ private BankInfoListRequest( * @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; } @@ -113,16 +116,22 @@ public Optional> getExpand() { *
    • CHECKING - CHECKING
    • *
    */ - @JsonProperty("account_type") + @JsonIgnore public Optional getAccountType() { + if (accountType == null) { + return Optional.empty(); + } return accountType; } /** * @return If provided, will only return BankInfo's with this bank name. */ - @JsonProperty("bank_name") + @JsonIgnore public Optional getBankName() { + if (bankName == null) { + return Optional.empty(); + } return bankName; } @@ -218,15 +227,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -234,10 +246,28 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account_type") + private Optional _getAccountType() { + return accountType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("bank_name") + private Optional _getBankName() { + return bankName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -302,7 +332,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 accountType = Optional.empty(); @@ -330,11 +360,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -366,17 +396,17 @@ public Builder from(BankInfoListRequest 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(BankInfoListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -399,6 +429,17 @@ public Builder accountType(BankInfoListRequestAccountType accountType) { return this; } + public Builder accountType(Nullable accountType) { + if (accountType.isNull()) { + this.accountType = null; + } else if (accountType.isEmpty()) { + this.accountType = Optional.empty(); + } else { + this.accountType = Optional.of(accountType.get()); + } + return this; + } + /** *

    If provided, will only return BankInfo's with this bank name.

    */ @@ -413,6 +454,17 @@ public Builder bankName(String bankName) { return this; } + public Builder bankName(Nullable bankName) { + if (bankName.isNull()) { + this.bankName = null; + } else if (bankName.isEmpty()) { + this.bankName = Optional.empty(); + } else { + this.bankName = Optional.of(bankName.get()); + } + return this; + } + /** *

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

    */ @@ -571,12 +623,12 @@ public Builder pageSize(Integer pageSize) { *

    Deprecated. Use show_enum_origins.

    */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(BankInfoListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -595,16 +647,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(BankInfoListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/BankInfoListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequestExpandItem.java new file mode 100644 index 000000000..b278f08dc --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoListRequestExpandItem { + public static final BankInfoListRequestExpandItem EMPLOYEE = + new BankInfoListRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + BankInfoListRequestExpandItem(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 BankInfoListRequestExpandItem + && this.string.equals(((BankInfoListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoListRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new BankInfoListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BankInfoListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequestRemoteFields.java new file mode 100644 index 000000000..a1fd2a265 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoListRequestRemoteFields { + public static final BankInfoListRequestRemoteFields ACCOUNT_TYPE = + new BankInfoListRequestRemoteFields(Value.ACCOUNT_TYPE, "account_type"); + + private final Value value; + + private final String string; + + BankInfoListRequestRemoteFields(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 BankInfoListRequestRemoteFields + && this.string.equals(((BankInfoListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT_TYPE: + return visitor.visitAccountType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoListRequestRemoteFields valueOf(String value) { + switch (value) { + case "account_type": + return ACCOUNT_TYPE; + default: + return new BankInfoListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAccountType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BankInfoListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/BankInfoListRequestShowEnumOrigins.java new file mode 100644 index 000000000..314a50ff8 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoListRequestShowEnumOrigins { + public static final BankInfoListRequestShowEnumOrigins ACCOUNT_TYPE = + new BankInfoListRequestShowEnumOrigins(Value.ACCOUNT_TYPE, "account_type"); + + private final Value value; + + private final String string; + + BankInfoListRequestShowEnumOrigins(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 BankInfoListRequestShowEnumOrigins + && this.string.equals(((BankInfoListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT_TYPE: + return visitor.visitAccountType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "account_type": + return ACCOUNT_TYPE; + default: + return new BankInfoListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAccountType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java index 992c2f409..985f885d3 100644 --- a/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequest.java @@ -22,24 +22,24 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BankInfoRetrieveRequest.Builder.class) public final class BankInfoRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private BankInfoRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -53,7 +53,7 @@ private BankInfoRetrieveRequest( * @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; } @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -125,15 +125,15 @@ 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(); private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -153,17 +153,17 @@ public Builder from(BankInfoRetrieveRequest 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(BankInfoRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

    Deprecated. Use show_enum_origins.

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

    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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(BankInfoRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestExpandItem.java new file mode 100644 index 000000000..1416a0c1a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoRetrieveRequestExpandItem { + public static final BankInfoRetrieveRequestExpandItem EMPLOYEE = + new BankInfoRetrieveRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + BankInfoRetrieveRequestExpandItem(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 BankInfoRetrieveRequestExpandItem + && this.string.equals(((BankInfoRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new BankInfoRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..bf360bef9 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoRetrieveRequestRemoteFields { + public static final BankInfoRetrieveRequestRemoteFields ACCOUNT_TYPE = + new BankInfoRetrieveRequestRemoteFields(Value.ACCOUNT_TYPE, "account_type"); + + private final Value value; + + private final String string; + + BankInfoRetrieveRequestRemoteFields(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 BankInfoRetrieveRequestRemoteFields + && this.string.equals(((BankInfoRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT_TYPE: + return visitor.visitAccountType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "account_type": + return ACCOUNT_TYPE; + default: + return new BankInfoRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAccountType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..123c84c18 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BankInfoRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BankInfoRetrieveRequestShowEnumOrigins { + public static final BankInfoRetrieveRequestShowEnumOrigins ACCOUNT_TYPE = + new BankInfoRetrieveRequestShowEnumOrigins(Value.ACCOUNT_TYPE, "account_type"); + + private final Value value; + + private final String string; + + BankInfoRetrieveRequestShowEnumOrigins(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 BankInfoRetrieveRequestShowEnumOrigins + && this.string.equals(((BankInfoRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT_TYPE: + return visitor.visitAccountType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BankInfoRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "account_type": + return ACCOUNT_TYPE; + default: + return new BankInfoRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitAccountType(); + + T visitUnknown(String unknownType); + } +} 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..1715d50f2 100644 --- a/src/main/java/com/merge/api/hris/types/Benefit.java +++ b/src/main/java/com/merge/api/hris/types/Benefit.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -98,8 +101,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -122,56 +128,77 @@ public Optional getModifiedAt() { /** * @return The employee on the plan. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The name of the benefit provider. */ - @JsonProperty("provider_name") + @JsonIgnore public Optional getProviderName() { + if (providerName == null) { + return Optional.empty(); + } return providerName; } /** * @return The type of benefit plan */ - @JsonProperty("benefit_plan_type") + @JsonIgnore public Optional getBenefitPlanType() { + if (benefitPlanType == null) { + return Optional.empty(); + } return benefitPlanType; } /** * @return The employee's contribution. */ - @JsonProperty("employee_contribution") + @JsonIgnore public Optional getEmployeeContribution() { + if (employeeContribution == null) { + return Optional.empty(); + } return employeeContribution; } /** * @return The company's contribution. */ - @JsonProperty("company_contribution") + @JsonIgnore public Optional getCompanyContribution() { + if (companyContribution == null) { + return Optional.empty(); + } return companyContribution; } /** * @return The day and time the benefit started. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } /** * @return The day and time the benefit ended. */ - @JsonProperty("end_date") + @JsonIgnore public Optional getEndDate() { + if (endDate == null) { + return Optional.empty(); + } return endDate; } @@ -186,18 +213,93 @@ public Optional getRemoteWasDeleted() { /** * @return The employer benefit plan the employee is enrolled in. */ - @JsonProperty("employer_benefit") + @JsonIgnore public Optional getEmployerBenefit() { + if (employerBenefit == null) { + return Optional.empty(); + } return employerBenefit; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("provider_name") + private Optional _getProviderName() { + return providerName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("benefit_plan_type") + private Optional _getBenefitPlanType() { + return benefitPlanType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_contribution") + private Optional _getEmployeeContribution() { + return employeeContribution; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company_contribution") + private Optional _getCompanyContribution() { + return companyContribution; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_date") + private Optional _getEndDate() { + return endDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employer_benefit") + private Optional _getEmployerBenefit() { + return employerBenefit; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -340,6 +442,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -382,6 +495,17 @@ public Builder employee(BenefitEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The name of the benefit provider.

    */ @@ -396,6 +520,17 @@ public Builder providerName(String providerName) { return this; } + public Builder providerName(Nullable providerName) { + if (providerName.isNull()) { + this.providerName = null; + } else if (providerName.isEmpty()) { + this.providerName = Optional.empty(); + } else { + this.providerName = Optional.of(providerName.get()); + } + return this; + } + /** *

    The type of benefit plan

    */ @@ -410,6 +545,17 @@ public Builder benefitPlanType(String benefitPlanType) { return this; } + public Builder benefitPlanType(Nullable benefitPlanType) { + if (benefitPlanType.isNull()) { + this.benefitPlanType = null; + } else if (benefitPlanType.isEmpty()) { + this.benefitPlanType = Optional.empty(); + } else { + this.benefitPlanType = Optional.of(benefitPlanType.get()); + } + return this; + } + /** *

    The employee's contribution.

    */ @@ -424,6 +570,17 @@ public Builder employeeContribution(Double employeeContribution) { return this; } + public Builder employeeContribution(Nullable employeeContribution) { + if (employeeContribution.isNull()) { + this.employeeContribution = null; + } else if (employeeContribution.isEmpty()) { + this.employeeContribution = Optional.empty(); + } else { + this.employeeContribution = Optional.of(employeeContribution.get()); + } + return this; + } + /** *

    The company's contribution.

    */ @@ -438,6 +595,17 @@ public Builder companyContribution(Double companyContribution) { return this; } + public Builder companyContribution(Nullable companyContribution) { + if (companyContribution.isNull()) { + this.companyContribution = null; + } else if (companyContribution.isEmpty()) { + this.companyContribution = Optional.empty(); + } else { + this.companyContribution = Optional.of(companyContribution.get()); + } + return this; + } + /** *

    The day and time the benefit started.

    */ @@ -452,6 +620,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

    The day and time the benefit ended.

    */ @@ -466,6 +645,17 @@ public Builder endDate(OffsetDateTime endDate) { return this; } + public Builder endDate(Nullable endDate) { + if (endDate.isNull()) { + this.endDate = null; + } else if (endDate.isEmpty()) { + this.endDate = Optional.empty(); + } else { + this.endDate = Optional.of(endDate.get()); + } + 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.

    */ @@ -494,6 +684,17 @@ public Builder employerBenefit(String employerBenefit) { return this; } + public Builder employerBenefit(Nullable employerBenefit) { + if (employerBenefit.isNull()) { + this.employerBenefit = null; + } else if (employerBenefit.isEmpty()) { + this.employerBenefit = Optional.empty(); + } else { + this.employerBenefit = Optional.of(employerBenefit.get()); + } + return this; + } + @JsonSetter(value = "field_mappings", nulls = Nulls.SKIP) public Builder fieldMappings(Optional> fieldMappings) { this.fieldMappings = fieldMappings; @@ -505,6 +706,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -516,6 +728,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Benefit build() { return new Benefit( id, 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..c4e3d8193 100644 --- a/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/BenefitsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BenefitsListRequest.Builder.class) public final class BenefitsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class BenefitsListRequest { private final Map additionalProperties; private BenefitsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private BenefitsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 createdAfter = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(BenefitsListRequest 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(BenefitsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public BenefitsListRequest build() { return new BenefitsListRequest( expand, diff --git a/src/main/java/com/merge/api/hris/types/BenefitsListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/BenefitsListRequestExpandItem.java new file mode 100644 index 000000000..46f1a3017 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BenefitsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BenefitsListRequestExpandItem { + public static final BenefitsListRequestExpandItem EMPLOYEE = + new BenefitsListRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + BenefitsListRequestExpandItem(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 BenefitsListRequestExpandItem + && this.string.equals(((BenefitsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BenefitsListRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new BenefitsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java index 51bb50805..72627cb54 100644 --- a/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = BenefitsRetrieveRequest.Builder.class) public final class BenefitsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class BenefitsRetrieveRequest { private final Map additionalProperties; private BenefitsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private BenefitsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(BenefitsRetrieveRequest 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(BenefitsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..da2b6caad --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/BenefitsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class BenefitsRetrieveRequestExpandItem { + public static final BenefitsRetrieveRequestExpandItem EMPLOYEE = + new BenefitsRetrieveRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + BenefitsRetrieveRequestExpandItem(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 BenefitsRetrieveRequestExpandItem + && this.string.equals(((BenefitsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static BenefitsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new BenefitsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} 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..ef907148a 100644 --- a/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/CompaniesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public CompaniesListRequest build() { return new CompaniesListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/hris/types/Company.java b/src/main/java/com/merge/api/hris/types/Company.java index 61944ea55..44484eede 100644 --- a/src/main/java/com/merge/api/hris/types/Company.java +++ b/src/main/java/com/merge/api/hris/types/Company.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,24 +108,33 @@ public Optional getModifiedAt() { /** * @return The company's legal name. */ - @JsonProperty("legal_name") + @JsonIgnore public Optional getLegalName() { + if (legalName == null) { + return Optional.empty(); + } return legalName; } /** * @return The company's display name. */ - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } return displayName; } /** * @return The company's Employer Identification Numbers. */ - @JsonProperty("eins") + @JsonIgnore public Optional>> getEins() { + if (eins == null) { + return Optional.empty(); + } return eins; } @@ -131,13 +146,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("legal_name") + private Optional _getLegalName() { + return legalName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("eins") + private Optional>> _getEins() { + return eins; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -255,6 +312,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -297,6 +365,17 @@ public Builder legalName(String legalName) { return this; } + public Builder legalName(Nullable legalName) { + if (legalName.isNull()) { + this.legalName = null; + } else if (legalName.isEmpty()) { + this.legalName = Optional.empty(); + } else { + this.legalName = Optional.of(legalName.get()); + } + return this; + } + /** *

    The company's display name.

    */ @@ -311,6 +390,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + /** *

    The company's Employer Identification Numbers.

    */ @@ -325,6 +415,17 @@ public Builder eins(List> eins) { return this; } + public Builder eins(Nullable>> eins) { + if (eins.isNull()) { + this.eins = null; + } else if (eins.isEmpty()) { + this.eins = Optional.empty(); + } else { + this.eins = Optional.of(eins.get()); + } + 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.

    */ @@ -350,6 +451,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -361,6 +473,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Company build() { return new Company( id, diff --git a/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java index d5fcd0da5..da03b3278 100644 --- a/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/hris/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

    The data with the request. You must include a request_format parameter matching the data's format

    */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

    Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

    */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

    */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

    */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/Deduction.java b/src/main/java/com/merge/api/hris/types/Deduction.java index 949ed8a61..27d668e9f 100644 --- a/src/main/java/com/merge/api/hris/types/Deduction.java +++ b/src/main/java/com/merge/api/hris/types/Deduction.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -103,32 +109,44 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("employee_payroll_run") + @JsonIgnore public Optional getEmployeePayrollRun() { + if (employeePayrollRun == null) { + return Optional.empty(); + } return employeePayrollRun; } /** * @return The deduction's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The amount of money that is withheld from an employee's gross pay by the employee. */ - @JsonProperty("employee_deduction") + @JsonIgnore public Optional getEmployeeDeduction() { + if (employeeDeduction == null) { + return Optional.empty(); + } return employeeDeduction; } /** * @return The amount of money that is withheld on behalf of an employee by the company. */ - @JsonProperty("company_deduction") + @JsonIgnore public Optional getCompanyDeduction() { + if (companyDeduction == null) { + return Optional.empty(); + } return companyDeduction; } @@ -140,13 +158,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_payroll_run") + private Optional _getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_deduction") + private Optional _getEmployeeDeduction() { + return employeeDeduction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company_deduction") + private Optional _getCompanyDeduction() { + return companyDeduction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -269,6 +335,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -308,6 +385,17 @@ public Builder employeePayrollRun(String employeePayrollRun) { return this; } + public Builder employeePayrollRun(Nullable employeePayrollRun) { + if (employeePayrollRun.isNull()) { + this.employeePayrollRun = null; + } else if (employeePayrollRun.isEmpty()) { + this.employeePayrollRun = Optional.empty(); + } else { + this.employeePayrollRun = Optional.of(employeePayrollRun.get()); + } + return this; + } + /** *

    The deduction's name.

    */ @@ -322,6 +410,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

    The amount of money that is withheld from an employee's gross pay by the employee.

    */ @@ -336,6 +435,17 @@ public Builder employeeDeduction(Double employeeDeduction) { return this; } + public Builder employeeDeduction(Nullable employeeDeduction) { + if (employeeDeduction.isNull()) { + this.employeeDeduction = null; + } else if (employeeDeduction.isEmpty()) { + this.employeeDeduction = Optional.empty(); + } else { + this.employeeDeduction = Optional.of(employeeDeduction.get()); + } + return this; + } + /** *

    The amount of money that is withheld on behalf of an employee by the company.

    */ @@ -350,6 +460,17 @@ public Builder companyDeduction(Double companyDeduction) { return this; } + public Builder companyDeduction(Nullable companyDeduction) { + if (companyDeduction.isNull()) { + this.companyDeduction = null; + } else if (companyDeduction.isEmpty()) { + this.companyDeduction = Optional.empty(); + } else { + this.companyDeduction = Optional.of(companyDeduction.get()); + } + 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.

    */ @@ -375,6 +496,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -386,6 +518,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Deduction build() { return new Deduction( id, diff --git a/src/main/java/com/merge/api/hris/types/Dependent.java b/src/main/java/com/merge/api/hris/types/Dependent.java index be852b14d..eec6e6a60 100644 --- a/src/main/java/com/merge/api/hris/types/Dependent.java +++ b/src/main/java/com/merge/api/hris/types/Dependent.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -110,8 +113,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -134,24 +140,33 @@ public Optional getModifiedAt() { /** * @return The dependents's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The dependents's middle name. */ - @JsonProperty("middle_name") + @JsonIgnore public Optional getMiddleName() { + if (middleName == null) { + return Optional.empty(); + } return middleName; } /** * @return The dependents's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } @@ -163,24 +178,33 @@ public Optional getLastName() { *
  • DOMESTIC_PARTNER - DOMESTIC_PARTNER
  • * */ - @JsonProperty("relationship") + @JsonIgnore public Optional getRelationship() { + if (relationship == null) { + return Optional.empty(); + } return relationship; } /** * @return The employee this person is a dependent of. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The dependent's date of birth. */ - @JsonProperty("date_of_birth") + @JsonIgnore public Optional getDateOfBirth() { + if (dateOfBirth == null) { + return Optional.empty(); + } return dateOfBirth; } @@ -194,40 +218,55 @@ public Optional getDateOfBirth() { *
  • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
  • * */ - @JsonProperty("gender") + @JsonIgnore public Optional getGender() { + if (gender == null) { + return Optional.empty(); + } return gender; } /** * @return The dependent's phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return The dependents's home address. */ - @JsonProperty("home_location") + @JsonIgnore public Optional getHomeLocation() { + if (homeLocation == null) { + return Optional.empty(); + } return homeLocation; } /** * @return Whether or not the dependent is a student */ - @JsonProperty("is_student") + @JsonIgnore public Optional getIsStudent() { + if (isStudent == null) { + return Optional.empty(); + } return isStudent; } /** * @return The dependents's social security number. */ - @JsonProperty("ssn") + @JsonIgnore public Optional getSsn() { + if (ssn == null) { + return Optional.empty(); + } return ssn; } @@ -239,13 +278,103 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("middle_name") + private Optional _getMiddleName() { + return middleName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("relationship") + private Optional _getRelationship() { + return relationship; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_of_birth") + private Optional _getDateOfBirth() { + return dateOfBirth; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gender") + private Optional _getGender() { + return gender; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("home_location") + private Optional _getHomeLocation() { + return homeLocation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_student") + private Optional _getIsStudent() { + return isStudent; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ssn") + private Optional _getSsn() { + return ssn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -403,6 +532,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -445,6 +585,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

    The dependents's middle name.

    */ @@ -459,6 +610,17 @@ public Builder middleName(String middleName) { return this; } + public Builder middleName(Nullable middleName) { + if (middleName.isNull()) { + this.middleName = null; + } else if (middleName.isEmpty()) { + this.middleName = Optional.empty(); + } else { + this.middleName = Optional.of(middleName.get()); + } + return this; + } + /** *

    The dependents's last name.

    */ @@ -473,6 +635,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

    The dependent's relationship to the employee.

    *
      @@ -492,6 +665,17 @@ public Builder relationship(DependentRelationship relationship) { return this; } + public Builder relationship(Nullable relationship) { + if (relationship.isNull()) { + this.relationship = null; + } else if (relationship.isEmpty()) { + this.relationship = Optional.empty(); + } else { + this.relationship = Optional.of(relationship.get()); + } + return this; + } + /** *

      The employee this person is a dependent of.

      */ @@ -506,6 +690,17 @@ public Builder employee(String employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

      The dependent's date of birth.

      */ @@ -520,6 +715,17 @@ public Builder dateOfBirth(OffsetDateTime dateOfBirth) { return this; } + public Builder dateOfBirth(Nullable dateOfBirth) { + if (dateOfBirth.isNull()) { + this.dateOfBirth = null; + } else if (dateOfBirth.isEmpty()) { + this.dateOfBirth = Optional.empty(); + } else { + this.dateOfBirth = Optional.of(dateOfBirth.get()); + } + return this; + } + /** *

      The dependent's gender.

      *
        @@ -541,6 +747,17 @@ public Builder gender(DependentGender gender) { return this; } + public Builder gender(Nullable gender) { + if (gender.isNull()) { + this.gender = null; + } else if (gender.isEmpty()) { + this.gender = Optional.empty(); + } else { + this.gender = Optional.of(gender.get()); + } + return this; + } + /** *

        The dependent's phone number.

        */ @@ -555,6 +772,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

        The dependents's home address.

        */ @@ -569,6 +797,17 @@ public Builder homeLocation(String homeLocation) { return this; } + public Builder homeLocation(Nullable homeLocation) { + if (homeLocation.isNull()) { + this.homeLocation = null; + } else if (homeLocation.isEmpty()) { + this.homeLocation = Optional.empty(); + } else { + this.homeLocation = Optional.of(homeLocation.get()); + } + return this; + } + /** *

        Whether or not the dependent is a student

        */ @@ -583,6 +822,17 @@ public Builder isStudent(Boolean isStudent) { return this; } + public Builder isStudent(Nullable isStudent) { + if (isStudent.isNull()) { + this.isStudent = null; + } else if (isStudent.isEmpty()) { + this.isStudent = Optional.empty(); + } else { + this.isStudent = Optional.of(isStudent.get()); + } + return this; + } + /** *

        The dependents's social security number.

        */ @@ -597,6 +847,17 @@ public Builder ssn(String ssn) { return this; } + public Builder ssn(Nullable ssn) { + if (ssn.isNull()) { + this.ssn = null; + } else if (ssn.isEmpty()) { + this.ssn = Optional.empty(); + } else { + this.ssn = Optional.of(ssn.get()); + } + 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.

        */ @@ -622,6 +883,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -633,6 +905,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Dependent build() { return new Dependent( id, 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..a274b29b8 100644 --- a/src/main/java/com/merge/api/hris/types/DependentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/DependentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -155,8 +158,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -408,6 +420,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public DependentsListRequest build() { return new DependentsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/hris/types/Earning.java b/src/main/java/com/merge/api/hris/types/Earning.java index 4bf9089bd..386a166b8 100644 --- a/src/main/java/com/merge/api/hris/types/Earning.java +++ b/src/main/java/com/merge/api/hris/types/Earning.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -99,16 +105,22 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("employee_payroll_run") + @JsonIgnore public Optional getEmployeePayrollRun() { + if (employeePayrollRun == null) { + return Optional.empty(); + } return employeePayrollRun; } /** * @return The amount earned. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } @@ -121,8 +133,11 @@ public Optional getAmount() { *
      • BONUS - BONUS
      • *
      */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } @@ -134,13 +149,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_payroll_run") + private Optional _getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -258,6 +315,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

      The datetime that this object was created by Merge.

      */ @@ -297,6 +365,17 @@ public Builder employeePayrollRun(String employeePayrollRun) { return this; } + public Builder employeePayrollRun(Nullable employeePayrollRun) { + if (employeePayrollRun.isNull()) { + this.employeePayrollRun = null; + } else if (employeePayrollRun.isEmpty()) { + this.employeePayrollRun = Optional.empty(); + } else { + this.employeePayrollRun = Optional.of(employeePayrollRun.get()); + } + return this; + } + /** *

      The amount earned.

      */ @@ -311,6 +390,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

      The type of earning.

      *
        @@ -331,6 +421,17 @@ public Builder type(EarningType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + 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.

        */ @@ -356,6 +457,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -367,6 +479,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Earning build() { return new Earning( id, 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..ae509d9b2 100644 --- a/src/main/java/com/merge/api/hris/types/Employee.java +++ b/src/main/java/com/merge/api/hris/types/Employee.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -182,8 +185,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -206,56 +212,77 @@ public Optional getModifiedAt() { /** * @return The employee's number that appears in the third-party integration's UI. */ - @JsonProperty("employee_number") + @JsonIgnore public Optional getEmployeeNumber() { + if (employeeNumber == null) { + return Optional.empty(); + } return employeeNumber; } /** * @return The ID of the employee's company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The employee's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The employee's preferred first name. */ - @JsonProperty("preferred_name") + @JsonIgnore public Optional getPreferredName() { + if (preferredName == null) { + return Optional.empty(); + } return preferredName; } /** * @return 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. */ - @JsonProperty("display_full_name") + @JsonIgnore public Optional getDisplayFullName() { + if (displayFullName == null) { + return Optional.empty(); + } return displayFullName; } /** * @return The employee's username that appears in the remote UI. */ - @JsonProperty("username") + @JsonIgnore public Optional getUsername() { + if (username == null) { + return Optional.empty(); + } return username; } @@ -267,24 +294,33 @@ public Optional>> getGroups() { /** * @return The employee's work email. */ - @JsonProperty("work_email") + @JsonIgnore public Optional getWorkEmail() { + if (workEmail == null) { + return Optional.empty(); + } return workEmail; } /** * @return The employee's personal email. */ - @JsonProperty("personal_email") + @JsonIgnore public Optional getPersonalEmail() { + if (personalEmail == null) { + return Optional.empty(); + } return personalEmail; } /** * @return The employee's mobile phone number. */ - @JsonProperty("mobile_phone_number") + @JsonIgnore public Optional getMobilePhoneNumber() { + if (mobilePhoneNumber == null) { + return Optional.empty(); + } return mobilePhoneNumber; } @@ -299,48 +335,66 @@ public Optional>> getEmployments() { /** * @return The employee's home address. */ - @JsonProperty("home_location") + @JsonIgnore public Optional getHomeLocation() { + if (homeLocation == null) { + return Optional.empty(); + } return homeLocation; } /** * @return The employee's work address. */ - @JsonProperty("work_location") + @JsonIgnore public Optional getWorkLocation() { + if (workLocation == null) { + return Optional.empty(); + } return workLocation; } /** * @return The employee ID of the employee's manager. */ - @JsonProperty("manager") + @JsonIgnore public Optional getManager() { + if (manager == null) { + return Optional.empty(); + } return manager; } /** * @return The employee's team. */ - @JsonProperty("team") + @JsonIgnore public Optional getTeam() { + if (team == null) { + return Optional.empty(); + } return team; } /** * @return The employee's pay group */ - @JsonProperty("pay_group") + @JsonIgnore public Optional getPayGroup() { + if (payGroup == null) { + return Optional.empty(); + } return payGroup; } /** * @return The employee's social security number. */ - @JsonProperty("ssn") + @JsonIgnore public Optional getSsn() { + if (ssn == null) { + return Optional.empty(); + } return ssn; } @@ -354,8 +408,11 @@ public Optional getSsn() { *
      • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
      • *
      */ - @JsonProperty("gender") + @JsonIgnore public Optional getGender() { + if (gender == null) { + return Optional.empty(); + } return gender; } @@ -372,8 +429,11 @@ public Optional getGender() { *
    • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
    • *
    */ - @JsonProperty("ethnicity") + @JsonIgnore public Optional getEthnicity() { + if (ethnicity == null) { + return Optional.empty(); + } return ethnicity; } @@ -387,40 +447,55 @@ public Optional getEthnicity() { *
  • QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD
  • * */ - @JsonProperty("marital_status") + @JsonIgnore public Optional getMaritalStatus() { + if (maritalStatus == null) { + return Optional.empty(); + } return maritalStatus; } /** * @return The employee's date of birth. */ - @JsonProperty("date_of_birth") + @JsonIgnore public Optional getDateOfBirth() { + if (dateOfBirth == null) { + return Optional.empty(); + } return dateOfBirth; } /** * @return 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. */ - @JsonProperty("hire_date") + @JsonIgnore public Optional getHireDate() { + if (hireDate == null) { + return Optional.empty(); + } return hireDate; } /** * @return The date that the employee started working. If an employee was rehired, the most recent start date will be returned. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } /** * @return When the third party's employee was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -432,32 +507,44 @@ public Optional getRemoteCreatedAt() { *
  • INACTIVE - INACTIVE
  • * */ - @JsonProperty("employment_status") + @JsonIgnore public Optional getEmploymentStatus() { + if (employmentStatus == null) { + return Optional.empty(); + } return employmentStatus; } /** * @return The employee's termination date. */ - @JsonProperty("termination_date") + @JsonIgnore public Optional getTerminationDate() { + if (terminationDate == null) { + return Optional.empty(); + } return terminationDate; } /** * @return The URL of the employee's avatar image. */ - @JsonProperty("avatar") + @JsonIgnore public Optional getAvatar() { + if (avatar == null) { + return Optional.empty(); + } return avatar; } /** * @return Custom fields configured for a given model. */ - @JsonProperty("custom_fields") + @JsonIgnore public Optional> getCustomFields() { + if (customFields == null) { + return Optional.empty(); + } return customFields; } @@ -469,13 +556,199 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_number") + private Optional _getEmployeeNumber() { + return employeeNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("preferred_name") + private Optional _getPreferredName() { + return preferredName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_full_name") + private Optional _getDisplayFullName() { + return displayFullName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + private Optional _getUsername() { + return username; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("work_email") + private Optional _getWorkEmail() { + return workEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("personal_email") + private Optional _getPersonalEmail() { + return personalEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mobile_phone_number") + private Optional _getMobilePhoneNumber() { + return mobilePhoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("home_location") + private Optional _getHomeLocation() { + return homeLocation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("work_location") + private Optional _getWorkLocation() { + return workLocation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("manager") + private Optional _getManager() { + return manager; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("team") + private Optional _getTeam() { + return team; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_group") + private Optional _getPayGroup() { + return payGroup; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ssn") + private Optional _getSsn() { + return ssn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gender") + private Optional _getGender() { + return gender; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ethnicity") + private Optional _getEthnicity() { + return ethnicity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("marital_status") + private Optional _getMaritalStatus() { + return maritalStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_of_birth") + private Optional _getDateOfBirth() { + return dateOfBirth; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hire_date") + private Optional _getHireDate() { + return hireDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employment_status") + private Optional _getEmploymentStatus() { + return employmentStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("termination_date") + private Optional _getTerminationDate() { + return terminationDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("avatar") + private Optional _getAvatar() { + return avatar; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("custom_fields") + private Optional> _getCustomFields() { + return customFields; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -723,6 +996,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -765,6 +1049,17 @@ public Builder employeeNumber(String employeeNumber) { return this; } + public Builder employeeNumber(Nullable employeeNumber) { + if (employeeNumber.isNull()) { + this.employeeNumber = null; + } else if (employeeNumber.isEmpty()) { + this.employeeNumber = Optional.empty(); + } else { + this.employeeNumber = Optional.of(employeeNumber.get()); + } + return this; + } + /** *

    The ID of the employee's company.

    */ @@ -779,6 +1074,17 @@ public Builder company(EmployeeCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The employee's first name.

    */ @@ -793,6 +1099,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

    The employee's last name.

    */ @@ -807,6 +1124,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

    The employee's preferred first name.

    */ @@ -821,6 +1149,17 @@ public Builder preferredName(String preferredName) { return this; } + public Builder preferredName(Nullable preferredName) { + if (preferredName.isNull()) { + this.preferredName = null; + } else if (preferredName.isEmpty()) { + this.preferredName = Optional.empty(); + } else { + this.preferredName = Optional.of(preferredName.get()); + } + return this; + } + /** *

    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.

    */ @@ -835,6 +1174,17 @@ public Builder displayFullName(String displayFullName) { return this; } + public Builder displayFullName(Nullable displayFullName) { + if (displayFullName.isNull()) { + this.displayFullName = null; + } else if (displayFullName.isEmpty()) { + this.displayFullName = Optional.empty(); + } else { + this.displayFullName = Optional.of(displayFullName.get()); + } + return this; + } + /** *

    The employee's username that appears in the remote UI.

    */ @@ -849,6 +1199,17 @@ public Builder username(String username) { return this; } + public Builder username(Nullable username) { + if (username.isNull()) { + this.username = null; + } else if (username.isEmpty()) { + this.username = Optional.empty(); + } else { + this.username = Optional.of(username.get()); + } + return this; + } + @JsonSetter(value = "groups", nulls = Nulls.SKIP) public Builder groups(Optional>> groups) { this.groups = groups; @@ -874,6 +1235,17 @@ public Builder workEmail(String workEmail) { return this; } + public Builder workEmail(Nullable workEmail) { + if (workEmail.isNull()) { + this.workEmail = null; + } else if (workEmail.isEmpty()) { + this.workEmail = Optional.empty(); + } else { + this.workEmail = Optional.of(workEmail.get()); + } + return this; + } + /** *

    The employee's personal email.

    */ @@ -888,6 +1260,17 @@ public Builder personalEmail(String personalEmail) { return this; } + public Builder personalEmail(Nullable personalEmail) { + if (personalEmail.isNull()) { + this.personalEmail = null; + } else if (personalEmail.isEmpty()) { + this.personalEmail = Optional.empty(); + } else { + this.personalEmail = Optional.of(personalEmail.get()); + } + return this; + } + /** *

    The employee's mobile phone number.

    */ @@ -902,6 +1285,17 @@ public Builder mobilePhoneNumber(String mobilePhoneNumber) { return this; } + public Builder mobilePhoneNumber(Nullable mobilePhoneNumber) { + if (mobilePhoneNumber.isNull()) { + this.mobilePhoneNumber = null; + } else if (mobilePhoneNumber.isEmpty()) { + this.mobilePhoneNumber = Optional.empty(); + } else { + this.mobilePhoneNumber = Optional.of(mobilePhoneNumber.get()); + } + return this; + } + /** *

    Array of Employment IDs for this Employee.

    */ @@ -930,6 +1324,17 @@ public Builder homeLocation(EmployeeHomeLocation homeLocation) { return this; } + public Builder homeLocation(Nullable homeLocation) { + if (homeLocation.isNull()) { + this.homeLocation = null; + } else if (homeLocation.isEmpty()) { + this.homeLocation = Optional.empty(); + } else { + this.homeLocation = Optional.of(homeLocation.get()); + } + return this; + } + /** *

    The employee's work address.

    */ @@ -944,6 +1349,17 @@ public Builder workLocation(EmployeeWorkLocation workLocation) { return this; } + public Builder workLocation(Nullable workLocation) { + if (workLocation.isNull()) { + this.workLocation = null; + } else if (workLocation.isEmpty()) { + this.workLocation = Optional.empty(); + } else { + this.workLocation = Optional.of(workLocation.get()); + } + return this; + } + /** *

    The employee ID of the employee's manager.

    */ @@ -958,6 +1374,17 @@ public Builder manager(EmployeeManager manager) { return this; } + public Builder manager(Nullable manager) { + if (manager.isNull()) { + this.manager = null; + } else if (manager.isEmpty()) { + this.manager = Optional.empty(); + } else { + this.manager = Optional.of(manager.get()); + } + return this; + } + /** *

    The employee's team.

    */ @@ -972,6 +1399,17 @@ public Builder team(EmployeeTeam team) { return this; } + public Builder team(Nullable team) { + if (team.isNull()) { + this.team = null; + } else if (team.isEmpty()) { + this.team = Optional.empty(); + } else { + this.team = Optional.of(team.get()); + } + return this; + } + /** *

    The employee's pay group

    */ @@ -986,6 +1424,17 @@ public Builder payGroup(EmployeePayGroup payGroup) { return this; } + public Builder payGroup(Nullable payGroup) { + if (payGroup.isNull()) { + this.payGroup = null; + } else if (payGroup.isEmpty()) { + this.payGroup = Optional.empty(); + } else { + this.payGroup = Optional.of(payGroup.get()); + } + return this; + } + /** *

    The employee's social security number.

    */ @@ -1000,6 +1449,17 @@ public Builder ssn(String ssn) { return this; } + public Builder ssn(Nullable ssn) { + if (ssn.isNull()) { + this.ssn = null; + } else if (ssn.isEmpty()) { + this.ssn = Optional.empty(); + } else { + this.ssn = Optional.of(ssn.get()); + } + return this; + } + /** *

    The employee's gender.

    *
      @@ -1021,6 +1481,17 @@ public Builder gender(EmployeeGender gender) { return this; } + public Builder gender(Nullable gender) { + if (gender.isNull()) { + this.gender = null; + } else if (gender.isEmpty()) { + this.gender = Optional.empty(); + } else { + this.gender = Optional.of(gender.get()); + } + return this; + } + /** *

      The employee's ethnicity.

      *
        @@ -1045,6 +1516,17 @@ public Builder ethnicity(EmployeeEthnicity ethnicity) { return this; } + public Builder ethnicity(Nullable ethnicity) { + if (ethnicity.isNull()) { + this.ethnicity = null; + } else if (ethnicity.isEmpty()) { + this.ethnicity = Optional.empty(); + } else { + this.ethnicity = Optional.of(ethnicity.get()); + } + return this; + } + /** *

        The employee's filing status as related to marital status.

        *
          @@ -1066,6 +1548,17 @@ public Builder maritalStatus(EmployeeMaritalStatus maritalStatus) { return this; } + public Builder maritalStatus(Nullable maritalStatus) { + if (maritalStatus.isNull()) { + this.maritalStatus = null; + } else if (maritalStatus.isEmpty()) { + this.maritalStatus = Optional.empty(); + } else { + this.maritalStatus = Optional.of(maritalStatus.get()); + } + return this; + } + /** *

          The employee's date of birth.

          */ @@ -1080,6 +1573,17 @@ public Builder dateOfBirth(OffsetDateTime dateOfBirth) { return this; } + public Builder dateOfBirth(Nullable dateOfBirth) { + if (dateOfBirth.isNull()) { + this.dateOfBirth = null; + } else if (dateOfBirth.isEmpty()) { + this.dateOfBirth = Optional.empty(); + } else { + this.dateOfBirth = Optional.of(dateOfBirth.get()); + } + return this; + } + /** *

          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.

          */ @@ -1094,6 +1598,17 @@ public Builder hireDate(OffsetDateTime hireDate) { return this; } + public Builder hireDate(Nullable hireDate) { + if (hireDate.isNull()) { + this.hireDate = null; + } else if (hireDate.isEmpty()) { + this.hireDate = Optional.empty(); + } else { + this.hireDate = Optional.of(hireDate.get()); + } + return this; + } + /** *

          The date that the employee started working. If an employee was rehired, the most recent start date will be returned.

          */ @@ -1108,6 +1623,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

          When the third party's employee was created.

          */ @@ -1122,6 +1648,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

          The employment status of the employee.

          *
            @@ -1141,6 +1678,17 @@ public Builder employmentStatus(EmployeeEmploymentStatus employmentStatus) { return this; } + public Builder employmentStatus(Nullable employmentStatus) { + if (employmentStatus.isNull()) { + this.employmentStatus = null; + } else if (employmentStatus.isEmpty()) { + this.employmentStatus = Optional.empty(); + } else { + this.employmentStatus = Optional.of(employmentStatus.get()); + } + return this; + } + /** *

            The employee's termination date.

            */ @@ -1155,6 +1703,17 @@ public Builder terminationDate(OffsetDateTime terminationDate) { return this; } + public Builder terminationDate(Nullable terminationDate) { + if (terminationDate.isNull()) { + this.terminationDate = null; + } else if (terminationDate.isEmpty()) { + this.terminationDate = Optional.empty(); + } else { + this.terminationDate = Optional.of(terminationDate.get()); + } + return this; + } + /** *

            The URL of the employee's avatar image.

            */ @@ -1169,6 +1728,17 @@ public Builder avatar(String avatar) { return this; } + public Builder avatar(Nullable avatar) { + if (avatar.isNull()) { + this.avatar = null; + } else if (avatar.isEmpty()) { + this.avatar = Optional.empty(); + } else { + this.avatar = Optional.of(avatar.get()); + } + return this; + } + /** *

            Custom fields configured for a given model.

            */ @@ -1183,6 +1753,17 @@ public Builder customFields(Map customFields) { return this; } + public Builder customFields(Nullable> customFields) { + if (customFields.isNull()) { + this.customFields = null; + } else if (customFields.isEmpty()) { + this.customFields = Optional.empty(); + } else { + this.customFields = Optional.of(customFields.get()); + } + 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.

            */ @@ -1208,6 +1789,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1219,6 +1811,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Employee build() { return new Employee( id, diff --git a/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java b/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java index f6b30ed06..7d7784cc5 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRun.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,56 +136,77 @@ public Optional getModifiedAt() { /** * @return The employee whose payroll is being run. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The payroll being run. */ - @JsonProperty("payroll_run") + @JsonIgnore public Optional getPayrollRun() { + if (payrollRun == null) { + return Optional.empty(); + } return payrollRun; } /** * @return The total earnings throughout a given period for an employee before any deductions are made. */ - @JsonProperty("gross_pay") + @JsonIgnore public Optional getGrossPay() { + if (grossPay == null) { + return Optional.empty(); + } return grossPay; } /** * @return The take-home pay throughout a given period for an employee after deductions are made. */ - @JsonProperty("net_pay") + @JsonIgnore public Optional getNetPay() { + if (netPay == null) { + return Optional.empty(); + } return netPay; } /** * @return The day and time the payroll run started. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } /** * @return The day and time the payroll run ended. */ - @JsonProperty("end_date") + @JsonIgnore public Optional getEndDate() { + if (endDate == null) { + return Optional.empty(); + } return endDate; } /** * @return The day and time the payroll run was checked. */ - @JsonProperty("check_date") + @JsonIgnore public Optional getCheckDate() { + if (checkDate == null) { + return Optional.empty(); + } return checkDate; } @@ -206,13 +233,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payroll_run") + private Optional _getPayrollRun() { + return payrollRun; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gross_pay") + private Optional _getGrossPay() { + return grossPay; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("net_pay") + private Optional _getNetPay() { + return netPay; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_date") + private Optional _getEndDate() { + return endDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("check_date") + private Optional _getCheckDate() { + return checkDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -365,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -407,6 +511,17 @@ public Builder employee(EmployeePayrollRunEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

            The payroll being run.

            */ @@ -421,6 +536,17 @@ public Builder payrollRun(EmployeePayrollRunPayrollRun payrollRun) { return this; } + public Builder payrollRun(Nullable payrollRun) { + if (payrollRun.isNull()) { + this.payrollRun = null; + } else if (payrollRun.isEmpty()) { + this.payrollRun = Optional.empty(); + } else { + this.payrollRun = Optional.of(payrollRun.get()); + } + return this; + } + /** *

            The total earnings throughout a given period for an employee before any deductions are made.

            */ @@ -435,6 +561,17 @@ public Builder grossPay(Double grossPay) { return this; } + public Builder grossPay(Nullable grossPay) { + if (grossPay.isNull()) { + this.grossPay = null; + } else if (grossPay.isEmpty()) { + this.grossPay = Optional.empty(); + } else { + this.grossPay = Optional.of(grossPay.get()); + } + return this; + } + /** *

            The take-home pay throughout a given period for an employee after deductions are made.

            */ @@ -449,6 +586,17 @@ public Builder netPay(Double netPay) { return this; } + public Builder netPay(Nullable netPay) { + if (netPay.isNull()) { + this.netPay = null; + } else if (netPay.isEmpty()) { + this.netPay = Optional.empty(); + } else { + this.netPay = Optional.of(netPay.get()); + } + return this; + } + /** *

            The day and time the payroll run started.

            */ @@ -463,6 +611,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

            The day and time the payroll run ended.

            */ @@ -477,6 +636,17 @@ public Builder endDate(OffsetDateTime endDate) { return this; } + public Builder endDate(Nullable endDate) { + if (endDate.isNull()) { + this.endDate = null; + } else if (endDate.isEmpty()) { + this.endDate = Optional.empty(); + } else { + this.endDate = Optional.of(endDate.get()); + } + return this; + } + /** *

            The day and time the payroll run was checked.

            */ @@ -491,6 +661,17 @@ public Builder checkDate(OffsetDateTime checkDate) { return this; } + public Builder checkDate(Nullable checkDate) { + if (checkDate.isNull()) { + this.checkDate = null; + } else if (checkDate.isEmpty()) { + this.checkDate = Optional.empty(); + } else { + this.checkDate = Optional.of(checkDate.get()); + } + return this; + } + @JsonSetter(value = "earnings", nulls = Nulls.SKIP) public Builder earnings(Optional> earnings) { this.earnings = earnings; @@ -549,6 +730,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -560,6 +752,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public EmployeePayrollRun build() { return new EmployeePayrollRun( id, 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..5c77885a3 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeePayrollRunsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -141,16 +144,22 @@ public Optional getEmployeeId() { /** * @return If provided, will only return employee payroll runs ended after this datetime. */ - @JsonProperty("ended_after") + @JsonIgnore public Optional getEndedAfter() { + if (endedAfter == null) { + return Optional.empty(); + } return endedAfter; } /** * @return If provided, will only return employee payroll runs ended before this datetime. */ - @JsonProperty("ended_before") + @JsonIgnore public Optional getEndedBefore() { + if (endedBefore == null) { + return Optional.empty(); + } return endedBefore; } @@ -213,24 +222,63 @@ public Optional getPayrollRunId() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return employee payroll runs started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return employee payroll runs started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_after") + private Optional _getEndedAfter() { + return endedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_before") + private Optional _getEndedBefore() { + return endedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { return startedBefore; } @@ -447,6 +495,17 @@ public Builder endedAfter(OffsetDateTime endedAfter) { return this; } + public Builder endedAfter(Nullable endedAfter) { + if (endedAfter.isNull()) { + this.endedAfter = null; + } else if (endedAfter.isEmpty()) { + this.endedAfter = Optional.empty(); + } else { + this.endedAfter = Optional.of(endedAfter.get()); + } + return this; + } + /** *

            If provided, will only return employee payroll runs ended before this datetime.

            */ @@ -461,6 +520,17 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } + public Builder endedBefore(Nullable endedBefore) { + if (endedBefore.isNull()) { + this.endedBefore = null; + } else if (endedBefore.isEmpty()) { + this.endedBefore = Optional.empty(); + } else { + this.endedBefore = Optional.of(endedBefore.get()); + } + 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.

            */ @@ -573,6 +643,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            If provided, will only return employee payroll runs started after this datetime.

            */ @@ -587,6 +668,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

            If provided, will only return employee payroll runs started before this datetime.

            */ @@ -601,6 +693,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + public EmployeePayrollRunsListRequest build() { return new EmployeePayrollRunsListRequest( expand, 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..302f8e0b5 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeeRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeeRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -149,56 +152,77 @@ private EmployeeRequest( /** * @return The employee's number that appears in the third-party integration's UI. */ - @JsonProperty("employee_number") + @JsonIgnore public Optional getEmployeeNumber() { + if (employeeNumber == null) { + return Optional.empty(); + } return employeeNumber; } /** * @return The ID of the employee's company. */ - @JsonProperty("company") + @JsonIgnore public Optional getCompany() { + if (company == null) { + return Optional.empty(); + } return company; } /** * @return The employee's first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } /** * @return The employee's last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } /** * @return The employee's preferred first name. */ - @JsonProperty("preferred_name") + @JsonIgnore public Optional getPreferredName() { + if (preferredName == null) { + return Optional.empty(); + } return preferredName; } /** * @return 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. */ - @JsonProperty("display_full_name") + @JsonIgnore public Optional getDisplayFullName() { + if (displayFullName == null) { + return Optional.empty(); + } return displayFullName; } /** * @return The employee's username that appears in the remote UI. */ - @JsonProperty("username") + @JsonIgnore public Optional getUsername() { + if (username == null) { + return Optional.empty(); + } return username; } @@ -210,24 +234,33 @@ public Optional>> getGroups() { /** * @return The employee's work email. */ - @JsonProperty("work_email") + @JsonIgnore public Optional getWorkEmail() { + if (workEmail == null) { + return Optional.empty(); + } return workEmail; } /** * @return The employee's personal email. */ - @JsonProperty("personal_email") + @JsonIgnore public Optional getPersonalEmail() { + if (personalEmail == null) { + return Optional.empty(); + } return personalEmail; } /** * @return The employee's mobile phone number. */ - @JsonProperty("mobile_phone_number") + @JsonIgnore public Optional getMobilePhoneNumber() { + if (mobilePhoneNumber == null) { + return Optional.empty(); + } return mobilePhoneNumber; } @@ -242,48 +275,66 @@ public Optional>> getEmployments() /** * @return The employee's home address. */ - @JsonProperty("home_location") + @JsonIgnore public Optional getHomeLocation() { + if (homeLocation == null) { + return Optional.empty(); + } return homeLocation; } /** * @return The employee's work address. */ - @JsonProperty("work_location") + @JsonIgnore public Optional getWorkLocation() { + if (workLocation == null) { + return Optional.empty(); + } return workLocation; } /** * @return The employee ID of the employee's manager. */ - @JsonProperty("manager") + @JsonIgnore public Optional getManager() { + if (manager == null) { + return Optional.empty(); + } return manager; } /** * @return The employee's team. */ - @JsonProperty("team") + @JsonIgnore public Optional getTeam() { + if (team == null) { + return Optional.empty(); + } return team; } /** * @return The employee's pay group */ - @JsonProperty("pay_group") + @JsonIgnore public Optional getPayGroup() { + if (payGroup == null) { + return Optional.empty(); + } return payGroup; } /** * @return The employee's social security number. */ - @JsonProperty("ssn") + @JsonIgnore public Optional getSsn() { + if (ssn == null) { + return Optional.empty(); + } return ssn; } @@ -297,8 +348,11 @@ public Optional getSsn() { *
          • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
          • *
          */ - @JsonProperty("gender") + @JsonIgnore public Optional getGender() { + if (gender == null) { + return Optional.empty(); + } return gender; } @@ -315,8 +369,11 @@ public Optional getGender() { *
        • PREFER_NOT_TO_DISCLOSE - PREFER_NOT_TO_DISCLOSE
        • *
        */ - @JsonProperty("ethnicity") + @JsonIgnore public Optional getEthnicity() { + if (ethnicity == null) { + return Optional.empty(); + } return ethnicity; } @@ -330,32 +387,44 @@ public Optional getEthnicity() { *
      • QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD - QUALIFYING_WIDOW_OR_WIDOWER_WITH_DEPENDENT_CHILD
      • *
      */ - @JsonProperty("marital_status") + @JsonIgnore public Optional getMaritalStatus() { + if (maritalStatus == null) { + return Optional.empty(); + } return maritalStatus; } /** * @return The employee's date of birth. */ - @JsonProperty("date_of_birth") + @JsonIgnore public Optional getDateOfBirth() { + if (dateOfBirth == null) { + return Optional.empty(); + } return dateOfBirth; } /** * @return 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. */ - @JsonProperty("hire_date") + @JsonIgnore public Optional getHireDate() { + if (hireDate == null) { + return Optional.empty(); + } return hireDate; } /** * @return The date that the employee started working. If an employee was rehired, the most recent start date will be returned. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } @@ -367,34 +436,211 @@ public Optional getStartDate() { *
    • INACTIVE - INACTIVE
    • *
    */ - @JsonProperty("employment_status") + @JsonIgnore public Optional getEmploymentStatus() { + if (employmentStatus == null) { + return Optional.empty(); + } return employmentStatus; } /** * @return The employee's termination date. */ - @JsonProperty("termination_date") + @JsonIgnore public Optional getTerminationDate() { + if (terminationDate == null) { + return Optional.empty(); + } return terminationDate; } /** * @return The URL of the employee's avatar image. */ - @JsonProperty("avatar") + @JsonIgnore public Optional getAvatar() { + if (avatar == null) { + return Optional.empty(); + } return avatar; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_number") + private Optional _getEmployeeNumber() { + return employeeNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("company") + private Optional _getCompany() { + return company; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("preferred_name") + private Optional _getPreferredName() { + return preferredName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_full_name") + private Optional _getDisplayFullName() { + return displayFullName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("username") + private Optional _getUsername() { + return username; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("work_email") + private Optional _getWorkEmail() { + return workEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("personal_email") + private Optional _getPersonalEmail() { + return personalEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mobile_phone_number") + private Optional _getMobilePhoneNumber() { + return mobilePhoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("home_location") + private Optional _getHomeLocation() { + return homeLocation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("work_location") + private Optional _getWorkLocation() { + return workLocation; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("manager") + private Optional _getManager() { + return manager; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("team") + private Optional _getTeam() { + return team; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_group") + private Optional _getPayGroup() { + return payGroup; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ssn") + private Optional _getSsn() { + return ssn; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("gender") + private Optional _getGender() { + return gender; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ethnicity") + private Optional _getEthnicity() { + return ethnicity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("marital_status") + private Optional _getMaritalStatus() { + return maritalStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("date_of_birth") + private Optional _getDateOfBirth() { + return dateOfBirth; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hire_date") + private Optional _getHireDate() { + return hireDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employment_status") + private Optional _getEmploymentStatus() { + return employmentStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("termination_date") + private Optional _getTerminationDate() { + return terminationDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("avatar") + private Optional _getAvatar() { + return avatar; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -596,6 +842,17 @@ public Builder employeeNumber(String employeeNumber) { return this; } + public Builder employeeNumber(Nullable employeeNumber) { + if (employeeNumber.isNull()) { + this.employeeNumber = null; + } else if (employeeNumber.isEmpty()) { + this.employeeNumber = Optional.empty(); + } else { + this.employeeNumber = Optional.of(employeeNumber.get()); + } + return this; + } + /** *

    The ID of the employee's company.

    */ @@ -610,6 +867,17 @@ public Builder company(EmployeeRequestCompany company) { return this; } + public Builder company(Nullable company) { + if (company.isNull()) { + this.company = null; + } else if (company.isEmpty()) { + this.company = Optional.empty(); + } else { + this.company = Optional.of(company.get()); + } + return this; + } + /** *

    The employee's first name.

    */ @@ -624,6 +892,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

    The employee's last name.

    */ @@ -638,6 +917,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

    The employee's preferred first name.

    */ @@ -652,6 +942,17 @@ public Builder preferredName(String preferredName) { return this; } + public Builder preferredName(Nullable preferredName) { + if (preferredName.isNull()) { + this.preferredName = null; + } else if (preferredName.isEmpty()) { + this.preferredName = Optional.empty(); + } else { + this.preferredName = Optional.of(preferredName.get()); + } + return this; + } + /** *

    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.

    */ @@ -666,6 +967,17 @@ public Builder displayFullName(String displayFullName) { return this; } + public Builder displayFullName(Nullable displayFullName) { + if (displayFullName.isNull()) { + this.displayFullName = null; + } else if (displayFullName.isEmpty()) { + this.displayFullName = Optional.empty(); + } else { + this.displayFullName = Optional.of(displayFullName.get()); + } + return this; + } + /** *

    The employee's username that appears in the remote UI.

    */ @@ -680,6 +992,17 @@ public Builder username(String username) { return this; } + public Builder username(Nullable username) { + if (username.isNull()) { + this.username = null; + } else if (username.isEmpty()) { + this.username = Optional.empty(); + } else { + this.username = Optional.of(username.get()); + } + return this; + } + @JsonSetter(value = "groups", nulls = Nulls.SKIP) public Builder groups(Optional>> groups) { this.groups = groups; @@ -705,6 +1028,17 @@ public Builder workEmail(String workEmail) { return this; } + public Builder workEmail(Nullable workEmail) { + if (workEmail.isNull()) { + this.workEmail = null; + } else if (workEmail.isEmpty()) { + this.workEmail = Optional.empty(); + } else { + this.workEmail = Optional.of(workEmail.get()); + } + return this; + } + /** *

    The employee's personal email.

    */ @@ -719,6 +1053,17 @@ public Builder personalEmail(String personalEmail) { return this; } + public Builder personalEmail(Nullable personalEmail) { + if (personalEmail.isNull()) { + this.personalEmail = null; + } else if (personalEmail.isEmpty()) { + this.personalEmail = Optional.empty(); + } else { + this.personalEmail = Optional.of(personalEmail.get()); + } + return this; + } + /** *

    The employee's mobile phone number.

    */ @@ -733,6 +1078,17 @@ public Builder mobilePhoneNumber(String mobilePhoneNumber) { return this; } + public Builder mobilePhoneNumber(Nullable mobilePhoneNumber) { + if (mobilePhoneNumber.isNull()) { + this.mobilePhoneNumber = null; + } else if (mobilePhoneNumber.isEmpty()) { + this.mobilePhoneNumber = Optional.empty(); + } else { + this.mobilePhoneNumber = Optional.of(mobilePhoneNumber.get()); + } + return this; + } + /** *

    Array of Employment IDs for this Employee.

    */ @@ -761,6 +1117,17 @@ public Builder homeLocation(EmployeeRequestHomeLocation homeLocation) { return this; } + public Builder homeLocation(Nullable homeLocation) { + if (homeLocation.isNull()) { + this.homeLocation = null; + } else if (homeLocation.isEmpty()) { + this.homeLocation = Optional.empty(); + } else { + this.homeLocation = Optional.of(homeLocation.get()); + } + return this; + } + /** *

    The employee's work address.

    */ @@ -775,6 +1142,17 @@ public Builder workLocation(EmployeeRequestWorkLocation workLocation) { return this; } + public Builder workLocation(Nullable workLocation) { + if (workLocation.isNull()) { + this.workLocation = null; + } else if (workLocation.isEmpty()) { + this.workLocation = Optional.empty(); + } else { + this.workLocation = Optional.of(workLocation.get()); + } + return this; + } + /** *

    The employee ID of the employee's manager.

    */ @@ -789,6 +1167,17 @@ public Builder manager(EmployeeRequestManager manager) { return this; } + public Builder manager(Nullable manager) { + if (manager.isNull()) { + this.manager = null; + } else if (manager.isEmpty()) { + this.manager = Optional.empty(); + } else { + this.manager = Optional.of(manager.get()); + } + return this; + } + /** *

    The employee's team.

    */ @@ -803,6 +1192,17 @@ public Builder team(EmployeeRequestTeam team) { return this; } + public Builder team(Nullable team) { + if (team.isNull()) { + this.team = null; + } else if (team.isEmpty()) { + this.team = Optional.empty(); + } else { + this.team = Optional.of(team.get()); + } + return this; + } + /** *

    The employee's pay group

    */ @@ -817,6 +1217,17 @@ public Builder payGroup(EmployeeRequestPayGroup payGroup) { return this; } + public Builder payGroup(Nullable payGroup) { + if (payGroup.isNull()) { + this.payGroup = null; + } else if (payGroup.isEmpty()) { + this.payGroup = Optional.empty(); + } else { + this.payGroup = Optional.of(payGroup.get()); + } + return this; + } + /** *

    The employee's social security number.

    */ @@ -831,6 +1242,17 @@ public Builder ssn(String ssn) { return this; } + public Builder ssn(Nullable ssn) { + if (ssn.isNull()) { + this.ssn = null; + } else if (ssn.isEmpty()) { + this.ssn = Optional.empty(); + } else { + this.ssn = Optional.of(ssn.get()); + } + return this; + } + /** *

    The employee's gender.

    *
      @@ -852,6 +1274,17 @@ public Builder gender(EmployeeRequestGender gender) { return this; } + public Builder gender(Nullable gender) { + if (gender.isNull()) { + this.gender = null; + } else if (gender.isEmpty()) { + this.gender = Optional.empty(); + } else { + this.gender = Optional.of(gender.get()); + } + return this; + } + /** *

      The employee's ethnicity.

      *
        @@ -876,6 +1309,17 @@ public Builder ethnicity(EmployeeRequestEthnicity ethnicity) { return this; } + public Builder ethnicity(Nullable ethnicity) { + if (ethnicity.isNull()) { + this.ethnicity = null; + } else if (ethnicity.isEmpty()) { + this.ethnicity = Optional.empty(); + } else { + this.ethnicity = Optional.of(ethnicity.get()); + } + return this; + } + /** *

        The employee's filing status as related to marital status.

        *
          @@ -897,6 +1341,17 @@ public Builder maritalStatus(EmployeeRequestMaritalStatus maritalStatus) { return this; } + public Builder maritalStatus(Nullable maritalStatus) { + if (maritalStatus.isNull()) { + this.maritalStatus = null; + } else if (maritalStatus.isEmpty()) { + this.maritalStatus = Optional.empty(); + } else { + this.maritalStatus = Optional.of(maritalStatus.get()); + } + return this; + } + /** *

          The employee's date of birth.

          */ @@ -911,6 +1366,17 @@ public Builder dateOfBirth(OffsetDateTime dateOfBirth) { return this; } + public Builder dateOfBirth(Nullable dateOfBirth) { + if (dateOfBirth.isNull()) { + this.dateOfBirth = null; + } else if (dateOfBirth.isEmpty()) { + this.dateOfBirth = Optional.empty(); + } else { + this.dateOfBirth = Optional.of(dateOfBirth.get()); + } + return this; + } + /** *

          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.

          */ @@ -925,6 +1391,17 @@ public Builder hireDate(OffsetDateTime hireDate) { return this; } + public Builder hireDate(Nullable hireDate) { + if (hireDate.isNull()) { + this.hireDate = null; + } else if (hireDate.isEmpty()) { + this.hireDate = Optional.empty(); + } else { + this.hireDate = Optional.of(hireDate.get()); + } + return this; + } + /** *

          The date that the employee started working. If an employee was rehired, the most recent start date will be returned.

          */ @@ -939,6 +1416,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

          The employment status of the employee.

          *
            @@ -958,6 +1446,17 @@ public Builder employmentStatus(EmployeeRequestEmploymentStatus employmentStatus return this; } + public Builder employmentStatus(Nullable employmentStatus) { + if (employmentStatus.isNull()) { + this.employmentStatus = null; + } else if (employmentStatus.isEmpty()) { + this.employmentStatus = Optional.empty(); + } else { + this.employmentStatus = Optional.of(employmentStatus.get()); + } + return this; + } + /** *

            The employee's termination date.

            */ @@ -972,6 +1471,17 @@ public Builder terminationDate(OffsetDateTime terminationDate) { return this; } + public Builder terminationDate(Nullable terminationDate) { + if (terminationDate.isNull()) { + this.terminationDate = null; + } else if (terminationDate.isEmpty()) { + this.terminationDate = Optional.empty(); + } else { + this.terminationDate = Optional.of(terminationDate.get()); + } + return this; + } + /** *

            The URL of the employee's avatar image.

            */ @@ -986,6 +1496,17 @@ public Builder avatar(String avatar) { return this; } + public Builder avatar(Nullable avatar) { + if (avatar.isNull()) { + this.avatar = null; + } else if (avatar.isEmpty()) { + this.avatar = Optional.empty(); + } else { + this.avatar = Optional.of(avatar.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -997,6 +1518,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -1008,6 +1540,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public EmployeeRequest build() { return new EmployeeRequest( employeeNumber, diff --git a/src/main/java/com/merge/api/hris/types/EmployeesIgnoreCreateRequest.java b/src/main/java/com/merge/api/hris/types/EmployeesIgnoreCreateRequest.java new file mode 100644 index 000000000..8df932407 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/EmployeesIgnoreCreateRequest.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.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 = EmployeesIgnoreCreateRequest.Builder.class) +public final class EmployeesIgnoreCreateRequest { + private final IgnoreCommonModelRequest body; + + private final Map additionalProperties; + + private EmployeesIgnoreCreateRequest(IgnoreCommonModelRequest body, Map additionalProperties) { + this.body = body; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("body") + public IgnoreCommonModelRequest getBody() { + return body; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof EmployeesIgnoreCreateRequest && equalTo((EmployeesIgnoreCreateRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(EmployeesIgnoreCreateRequest other) { + return body.equals(other.body); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.body); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BodyStage builder() { + return new Builder(); + } + + public interface BodyStage { + _FinalStage body(@NotNull IgnoreCommonModelRequest body); + + Builder from(EmployeesIgnoreCreateRequest other); + } + + public interface _FinalStage { + EmployeesIgnoreCreateRequest build(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BodyStage, _FinalStage { + private IgnoreCommonModelRequest body; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(EmployeesIgnoreCreateRequest other) { + body(other.getBody()); + return this; + } + + @java.lang.Override + @JsonSetter("body") + public _FinalStage body(@NotNull IgnoreCommonModelRequest body) { + this.body = body; + return this; + } + + @java.lang.Override + public EmployeesIgnoreCreateRequest build() { + return new EmployeesIgnoreCreateRequest(body, additionalProperties); + } + } +} 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..e1b4d6d68 100644 --- a/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployeesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -205,8 +208,11 @@ public Optional getCursor() { /** * @return If provided, will only return employees with this display name. */ - @JsonProperty("display_full_name") + @JsonIgnore public Optional getDisplayFullName() { + if (displayFullName == null) { + return Optional.empty(); + } return displayFullName; } @@ -218,8 +224,11 @@ public Optional getDisplayFullName() { *
          • INACTIVE - INACTIVE
          • *
          */ - @JsonProperty("employment_status") + @JsonIgnore public Optional getEmploymentStatus() { + if (employmentStatus == null) { + return Optional.empty(); + } return employmentStatus; } @@ -234,8 +243,11 @@ public Optional getEmploymentType() { /** * @return If provided, will only return employees with this first name. */ - @JsonProperty("first_name") + @JsonIgnore public Optional getFirstName() { + if (firstName == null) { + return Optional.empty(); + } return firstName; } @@ -298,8 +310,11 @@ public Optional getJobTitle() { /** * @return If provided, will only return employees with this last name. */ - @JsonProperty("last_name") + @JsonIgnore public Optional getLastName() { + if (lastName == null) { + return Optional.empty(); + } return lastName; } @@ -346,8 +361,11 @@ public Optional getPayGroupId() { /** * @return If provided, will only return Employees with this personal email */ - @JsonProperty("personal_email") + @JsonIgnore public Optional getPersonalEmail() { + if (personalEmail == null) { + return Optional.empty(); + } return personalEmail; } @@ -362,8 +380,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -378,16 +399,22 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return employees that started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return employees that started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } return startedBefore; } @@ -402,24 +429,33 @@ public Optional getTeamId() { /** * @return If provided, will only return employees that were terminated after this datetime. */ - @JsonProperty("terminated_after") + @JsonIgnore public Optional getTerminatedAfter() { + if (terminatedAfter == null) { + return Optional.empty(); + } return terminatedAfter; } /** * @return If provided, will only return employees that were terminated before this datetime. */ - @JsonProperty("terminated_before") + @JsonIgnore public Optional getTerminatedBefore() { + if (terminatedBefore == null) { + return Optional.empty(); + } return terminatedBefore; } /** * @return If provided, will only return Employees with this work email */ - @JsonProperty("work_email") + @JsonIgnore public Optional getWorkEmail() { + if (workEmail == null) { + return Optional.empty(); + } return workEmail; } @@ -431,6 +467,72 @@ public Optional getWorkLocationId() { return workLocationId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_full_name") + private Optional _getDisplayFullName() { + return displayFullName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employment_status") + private Optional _getEmploymentStatus() { + return employmentStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_name") + private Optional _getFirstName() { + return firstName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_name") + private Optional _getLastName() { + return lastName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("personal_email") + private Optional _getPersonalEmail() { + return personalEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("terminated_after") + private Optional _getTerminatedAfter() { + return terminatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("terminated_before") + private Optional _getTerminatedBefore() { + return terminatedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("work_email") + private Optional _getWorkEmail() { + return workEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -724,6 +826,17 @@ public Builder displayFullName(String displayFullName) { return this; } + public Builder displayFullName(Nullable displayFullName) { + if (displayFullName.isNull()) { + this.displayFullName = null; + } else if (displayFullName.isEmpty()) { + this.displayFullName = Optional.empty(); + } else { + this.displayFullName = Optional.of(displayFullName.get()); + } + return this; + } + /** *

          If provided, will only return employees with this employment status.

          *
            @@ -743,6 +856,17 @@ public Builder employmentStatus(EmployeesListRequestEmploymentStatus employmentS return this; } + public Builder employmentStatus(Nullable employmentStatus) { + if (employmentStatus.isNull()) { + this.employmentStatus = null; + } else if (employmentStatus.isEmpty()) { + this.employmentStatus = Optional.empty(); + } else { + this.employmentStatus = Optional.of(employmentStatus.get()); + } + return this; + } + /** *

            If provided, will only return employees that have an employment of the specified employment_type.

            */ @@ -771,6 +895,17 @@ public Builder firstName(String firstName) { return this; } + public Builder firstName(Nullable firstName) { + if (firstName.isNull()) { + this.firstName = null; + } else if (firstName.isEmpty()) { + this.firstName = Optional.empty(); + } else { + this.firstName = Optional.of(firstName.get()); + } + return this; + } + /** *

            If provided, will only return employees matching the group ids; multiple groups can be separated by commas.

            */ @@ -883,6 +1018,17 @@ public Builder lastName(String lastName) { return this; } + public Builder lastName(Nullable lastName) { + if (lastName.isNull()) { + this.lastName = null; + } else if (lastName.isEmpty()) { + this.lastName = Optional.empty(); + } else { + this.lastName = Optional.of(lastName.get()); + } + return this; + } + /** *

            If provided, will only return employees for this manager.

            */ @@ -967,6 +1113,17 @@ public Builder personalEmail(String personalEmail) { return this; } + public Builder personalEmail(Nullable personalEmail) { + if (personalEmail.isNull()) { + this.personalEmail = null; + } else if (personalEmail.isEmpty()) { + this.personalEmail = Optional.empty(); + } else { + this.personalEmail = Optional.of(personalEmail.get()); + } + return this; + } + /** *

            Deprecated. Use show_enum_origins.

            */ @@ -995,6 +1152,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

            */ @@ -1023,6 +1191,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

            If provided, will only return employees that started before this datetime.

            */ @@ -1037,6 +1216,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + /** *

            If provided, will only return employees for this team.

            */ @@ -1065,6 +1255,17 @@ public Builder terminatedAfter(OffsetDateTime terminatedAfter) { return this; } + public Builder terminatedAfter(Nullable terminatedAfter) { + if (terminatedAfter.isNull()) { + this.terminatedAfter = null; + } else if (terminatedAfter.isEmpty()) { + this.terminatedAfter = Optional.empty(); + } else { + this.terminatedAfter = Optional.of(terminatedAfter.get()); + } + return this; + } + /** *

            If provided, will only return employees that were terminated before this datetime.

            */ @@ -1079,6 +1280,17 @@ public Builder terminatedBefore(OffsetDateTime terminatedBefore) { return this; } + public Builder terminatedBefore(Nullable terminatedBefore) { + if (terminatedBefore.isNull()) { + this.terminatedBefore = null; + } else if (terminatedBefore.isEmpty()) { + this.terminatedBefore = Optional.empty(); + } else { + this.terminatedBefore = Optional.of(terminatedBefore.get()); + } + return this; + } + /** *

            If provided, will only return Employees with this work email

            */ @@ -1093,6 +1305,17 @@ public Builder workEmail(String workEmail) { return this; } + public Builder workEmail(Nullable workEmail) { + if (workEmail.isNull()) { + this.workEmail = null; + } else if (workEmail.isEmpty()) { + this.workEmail = Optional.empty(); + } else { + this.workEmail = Optional.of(workEmail.get()); + } + return this; + } + /** *

            If provided, will only return employees for this location.

            */ diff --git a/src/main/java/com/merge/api/hris/types/EmployerBenefit.java b/src/main/java/com/merge/api/hris/types/EmployerBenefit.java index f77047146..7eda4193a 100644 --- a/src/main/java/com/merge/api/hris/types/EmployerBenefit.java +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefit.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -113,32 +119,44 @@ public Optional getModifiedAt() { *
          • OTHER - OTHER
          • *
          */ - @JsonProperty("benefit_plan_type") + @JsonIgnore public Optional getBenefitPlanType() { + if (benefitPlanType == null) { + return Optional.empty(); + } return benefitPlanType; } /** * @return The employer benefit's name - typically the carrier or network name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The employer benefit's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } /** * @return The employer benefit's deduction code. */ - @JsonProperty("deduction_code") + @JsonIgnore public Optional getDeductionCode() { + if (deductionCode == null) { + return Optional.empty(); + } return deductionCode; } @@ -150,13 +168,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("benefit_plan_type") + private Optional _getBenefitPlanType() { + return benefitPlanType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("deduction_code") + private Optional _getDeductionCode() { + return deductionCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -279,6 +345,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -328,6 +405,17 @@ public Builder benefitPlanType(EmployerBenefitBenefitPlanType benefitPlanType) { return this; } + public Builder benefitPlanType(Nullable benefitPlanType) { + if (benefitPlanType.isNull()) { + this.benefitPlanType = null; + } else if (benefitPlanType.isEmpty()) { + this.benefitPlanType = Optional.empty(); + } else { + this.benefitPlanType = Optional.of(benefitPlanType.get()); + } + return this; + } + /** *

          The employer benefit's name - typically the carrier or network name.

          */ @@ -342,6 +430,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The employer benefit's description.

          */ @@ -356,6 +455,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The employer benefit's deduction code.

          */ @@ -370,6 +480,17 @@ public Builder deductionCode(String deductionCode) { return this; } + public Builder deductionCode(Nullable deductionCode) { + if (deductionCode.isNull()) { + this.deductionCode = null; + } else if (deductionCode.isEmpty()) { + this.deductionCode = Optional.empty(); + } else { + this.deductionCode = Optional.of(deductionCode.get()); + } + 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.

          */ @@ -395,6 +516,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -406,6 +538,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public EmployerBenefit build() { return new EmployerBenefit( id, 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..d2c808ee9 100644 --- a/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmployerBenefitsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public EmployerBenefitsListRequest build() { return new EmployerBenefitsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/hris/types/Employment.java b/src/main/java/com/merge/api/hris/types/Employment.java index b79f51130..f9524be8b 100644 --- a/src/main/java/com/merge/api/hris/types/Employment.java +++ b/src/main/java/com/merge/api/hris/types/Employment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -106,8 +109,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -130,24 +136,33 @@ public Optional getModifiedAt() { /** * @return The employee holding this position. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The position's title. */ - @JsonProperty("job_title") + @JsonIgnore public Optional getJobTitle() { + if (jobTitle == null) { + return Optional.empty(); + } return jobTitle; } /** * @return The position's pay rate. */ - @JsonProperty("pay_rate") + @JsonIgnore public Optional getPayRate() { + if (payRate == null) { + return Optional.empty(); + } return payRate; } @@ -165,8 +180,11 @@ public Optional getPayRate() { *
        • YEAR - YEAR
        • *
        */ - @JsonProperty("pay_period") + @JsonIgnore public Optional getPayPeriod() { + if (payPeriod == null) { + return Optional.empty(); + } return payPeriod; } @@ -184,8 +202,11 @@ public Optional getPayPeriod() { *
      • SEMIMONTHLY - SEMIMONTHLY
      • *
      */ - @JsonProperty("pay_frequency") + @JsonIgnore public Optional getPayFrequency() { + if (payFrequency == null) { + return Optional.empty(); + } return payFrequency; } @@ -500,16 +521,22 @@ public Optional getPayFrequency() { *
    • ZWL - Zimbabwean Dollar (2009)
    • *
    */ - @JsonProperty("pay_currency") + @JsonIgnore public Optional getPayCurrency() { + if (payCurrency == null) { + return Optional.empty(); + } return payCurrency; } /** * @return The employment's pay group */ - @JsonProperty("pay_group") + @JsonIgnore public Optional getPayGroup() { + if (payGroup == null) { + return Optional.empty(); + } return payGroup; } @@ -522,16 +549,22 @@ public Optional getPayGroup() { *
  • OWNER - OWNER
  • * */ - @JsonProperty("flsa_status") + @JsonIgnore public Optional getFlsaStatus() { + if (flsaStatus == null) { + return Optional.empty(); + } return flsaStatus; } /** * @return The position's effective date. */ - @JsonProperty("effective_date") + @JsonIgnore public Optional getEffectiveDate() { + if (effectiveDate == null) { + return Optional.empty(); + } return effectiveDate; } @@ -545,8 +578,11 @@ public Optional getEffectiveDate() { *
  • FREELANCE - FREELANCE
  • * */ - @JsonProperty("employment_type") + @JsonIgnore public Optional getEmploymentType() { + if (employmentType == null) { + return Optional.empty(); + } return employmentType; } @@ -558,13 +594,97 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("job_title") + private Optional _getJobTitle() { + return jobTitle; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_rate") + private Optional _getPayRate() { + return payRate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_period") + private Optional _getPayPeriod() { + return payPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_frequency") + private Optional _getPayFrequency() { + return payFrequency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_currency") + private Optional _getPayCurrency() { + return payCurrency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_group") + private Optional _getPayGroup() { + return payGroup; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("flsa_status") + private Optional _getFlsaStatus() { + return flsaStatus; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("effective_date") + private Optional _getEffectiveDate() { + return effectiveDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employment_type") + private Optional _getEmploymentType() { + return employmentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -717,6 +837,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -759,6 +890,17 @@ public Builder employee(EmploymentEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The position's title.

    */ @@ -773,6 +915,17 @@ public Builder jobTitle(String jobTitle) { return this; } + public Builder jobTitle(Nullable jobTitle) { + if (jobTitle.isNull()) { + this.jobTitle = null; + } else if (jobTitle.isEmpty()) { + this.jobTitle = Optional.empty(); + } else { + this.jobTitle = Optional.of(jobTitle.get()); + } + return this; + } + /** *

    The position's pay rate.

    */ @@ -787,6 +940,17 @@ public Builder payRate(Double payRate) { return this; } + public Builder payRate(Nullable payRate) { + if (payRate.isNull()) { + this.payRate = null; + } else if (payRate.isEmpty()) { + this.payRate = Optional.empty(); + } else { + this.payRate = Optional.of(payRate.get()); + } + return this; + } + /** *

    The time period this pay rate encompasses.

    *
      @@ -812,6 +976,17 @@ public Builder payPeriod(EmploymentPayPeriod payPeriod) { return this; } + public Builder payPeriod(Nullable payPeriod) { + if (payPeriod.isNull()) { + this.payPeriod = null; + } else if (payPeriod.isEmpty()) { + this.payPeriod = Optional.empty(); + } else { + this.payPeriod = Optional.of(payPeriod.get()); + } + return this; + } + /** *

      The position's pay frequency.

      *
        @@ -837,6 +1012,17 @@ public Builder payFrequency(EmploymentPayFrequency payFrequency) { return this; } + public Builder payFrequency(Nullable payFrequency) { + if (payFrequency.isNull()) { + this.payFrequency = null; + } else if (payFrequency.isEmpty()) { + this.payFrequency = Optional.empty(); + } else { + this.payFrequency = Optional.of(payFrequency.get()); + } + return this; + } + /** *

        The position's currency code.

        *
          @@ -1159,6 +1345,17 @@ public Builder payCurrency(EmploymentPayCurrency payCurrency) { return this; } + public Builder payCurrency(Nullable payCurrency) { + if (payCurrency.isNull()) { + this.payCurrency = null; + } else if (payCurrency.isEmpty()) { + this.payCurrency = Optional.empty(); + } else { + this.payCurrency = Optional.of(payCurrency.get()); + } + return this; + } + /** *

          The employment's pay group

          */ @@ -1173,6 +1370,17 @@ public Builder payGroup(EmploymentPayGroup payGroup) { return this; } + public Builder payGroup(Nullable payGroup) { + if (payGroup.isNull()) { + this.payGroup = null; + } else if (payGroup.isEmpty()) { + this.payGroup = Optional.empty(); + } else { + this.payGroup = Optional.of(payGroup.get()); + } + return this; + } + /** *

          The position's FLSA status.

          *
            @@ -1193,6 +1401,17 @@ public Builder flsaStatus(EmploymentFlsaStatus flsaStatus) { return this; } + public Builder flsaStatus(Nullable flsaStatus) { + if (flsaStatus.isNull()) { + this.flsaStatus = null; + } else if (flsaStatus.isEmpty()) { + this.flsaStatus = Optional.empty(); + } else { + this.flsaStatus = Optional.of(flsaStatus.get()); + } + return this; + } + /** *

            The position's effective date.

            */ @@ -1207,6 +1426,17 @@ public Builder effectiveDate(OffsetDateTime effectiveDate) { return this; } + public Builder effectiveDate(Nullable effectiveDate) { + if (effectiveDate.isNull()) { + this.effectiveDate = null; + } else if (effectiveDate.isEmpty()) { + this.effectiveDate = Optional.empty(); + } else { + this.effectiveDate = Optional.of(effectiveDate.get()); + } + return this; + } + /** *

            The position's type of employment.

            *
              @@ -1228,6 +1458,17 @@ public Builder employmentType(EmploymentEmploymentType employmentType) { return this; } + public Builder employmentType(Nullable employmentType) { + if (employmentType.isNull()) { + this.employmentType = null; + } else if (employmentType.isEmpty()) { + this.employmentType = Optional.empty(); + } else { + this.employmentType = Optional.of(employmentType.get()); + } + 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.

              */ @@ -1253,6 +1494,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1264,6 +1516,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Employment build() { return new Employment( id, 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..7f0125a05 100644 --- a/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/EmploymentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -197,8 +200,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -210,6 +216,12 @@ public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -525,6 +537,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

              */ diff --git a/src/main/java/com/merge/api/hris/types/EncodingEnum.java b/src/main/java/com/merge/api/hris/types/EncodingEnum.java index ef5fa833c..b1759edf2 100644 --- a/src/main/java/com/merge/api/hris/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/hris/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } 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..346cb34c9 100644 --- a/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/hris/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
            • de - de
            • *
            */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

            */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

            */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

            */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

            */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

            The following subset of IETF language tags can be used to configure localization.

            *
              @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

              The boolean that indicates whether initial, periodic, and force syncs will be disabled.

              */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

              A JSON object containing integration-specific configuration options.

              */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

              A JSON object containing integration-specific configuration options.

              * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

              The following subset of IETF language tags can be used to configure localization.

              + *
                + *
              • en - en
              • + *
              • de - de
              • + *
              + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

              The following subset of IETF language tags can be used to configure localization.

              *
                @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java index 0cbe531e8..604b00b08 100644 --- a/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/hris/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, 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..b94e4bef0 100644 --- a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java index 35fd34c90..efde6c833 100644 --- a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index 584ce4440..7e1e9f74f 100644 --- a/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/hris/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/hris/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/hris/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..8b1d1f6f9 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(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..58cd98888 100644 --- a/src/main/java/com/merge/api/hris/types/Group.java +++ b/src/main/java/com/merge/api/hris/types/Group.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,16 +112,22 @@ public Optional getModifiedAt() { /** * @return The parent group for this group. */ - @JsonProperty("parent_group") + @JsonIgnore public Optional getParentGroup() { + if (parentGroup == null) { + return Optional.empty(); + } return parentGroup; } /** * @return The group name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -129,16 +141,22 @@ public Optional getName() { *
              • GROUP - GROUP
              • *
              */ - @JsonProperty("type") + @JsonIgnore public Optional getType() { + if (type == null) { + return Optional.empty(); + } return type; } /** * @return 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. */ - @JsonProperty("is_commonly_used_as_team") + @JsonIgnore public Optional getIsCommonlyUsedAsTeam() { + if (isCommonlyUsedAsTeam == null) { + return Optional.empty(); + } return isCommonlyUsedAsTeam; } @@ -150,13 +168,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_group") + private Optional _getParentGroup() { + return parentGroup; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("type") + private Optional _getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_commonly_used_as_team") + private Optional _getIsCommonlyUsedAsTeam() { + return isCommonlyUsedAsTeam; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -279,6 +345,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

              The datetime that this object was created by Merge.

              */ @@ -321,6 +398,17 @@ public Builder parentGroup(String parentGroup) { return this; } + public Builder parentGroup(Nullable parentGroup) { + if (parentGroup.isNull()) { + this.parentGroup = null; + } else if (parentGroup.isEmpty()) { + this.parentGroup = Optional.empty(); + } else { + this.parentGroup = Optional.of(parentGroup.get()); + } + return this; + } + /** *

              The group name.

              */ @@ -335,6 +423,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

              The Group type returned directly from the third-party.

              *
                @@ -356,6 +455,17 @@ public Builder type(GroupType type) { return this; } + public Builder type(Nullable type) { + if (type.isNull()) { + this.type = null; + } else if (type.isEmpty()) { + this.type = Optional.empty(); + } else { + this.type = Optional.of(type.get()); + } + return this; + } + /** *

                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.

                */ @@ -370,6 +480,17 @@ public Builder isCommonlyUsedAsTeam(Boolean isCommonlyUsedAsTeam) { return this; } + public Builder isCommonlyUsedAsTeam(Nullable isCommonlyUsedAsTeam) { + if (isCommonlyUsedAsTeam.isNull()) { + this.isCommonlyUsedAsTeam = null; + } else if (isCommonlyUsedAsTeam.isEmpty()) { + this.isCommonlyUsedAsTeam = Optional.empty(); + } else { + this.isCommonlyUsedAsTeam = Optional.of(isCommonlyUsedAsTeam.get()); + } + 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.

                */ @@ -395,6 +516,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -406,6 +538,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Group build() { return new Group( id, 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..af4f6eebc 100644 --- a/src/main/java/com/merge/api/hris/types/GroupsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/GroupsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -43,11 +46,11 @@ public final class GroupsListRequest { private final Optional pageSize; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Optional types; @@ -65,9 +68,9 @@ private GroupsListRequest( Optional modifiedBefore, Optional names, Optional pageSize, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Optional types, Map additionalProperties) { this.createdAfter = createdAfter; @@ -180,15 +183,18 @@ public Optional getPageSize() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -196,7 +202,7 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -208,6 +214,12 @@ public Optional getTypes() { return types; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -290,11 +302,11 @@ public static final class Builder { private Optional pageSize = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); private Optional types = Optional.empty(); @@ -480,12 +492,12 @@ public Builder pageSize(Integer pageSize) { *

                Deprecated. Use show_enum_origins.

                */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(GroupsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -504,16 +516,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(GroupsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/GroupsListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/GroupsListRequestRemoteFields.java new file mode 100644 index 000000000..7dd5d77fc --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsListRequestRemoteFields.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsListRequestRemoteFields { + public static final GroupsListRequestRemoteFields TYPE = new GroupsListRequestRemoteFields(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + GroupsListRequestRemoteFields(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 GroupsListRequestRemoteFields + && this.string.equals(((GroupsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new GroupsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/GroupsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/GroupsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..cd261a679 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsListRequestShowEnumOrigins { + public static final GroupsListRequestShowEnumOrigins TYPE = + new GroupsListRequestShowEnumOrigins(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + GroupsListRequestShowEnumOrigins(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 GroupsListRequestShowEnumOrigins + && this.string.equals(((GroupsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new GroupsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java index 74838340a..7f42bd5e2 100644 --- a/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequest.java @@ -24,17 +24,17 @@ public final class GroupsRetrieveRequest { private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private GroupsRetrieveRequest( Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.includeRemoteData = includeRemoteData; this.includeShellData = includeShellData; @@ -63,7 +63,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -71,7 +71,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -113,9 +113,9 @@ public static final class Builder { private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -162,12 +162,12 @@ public Builder includeShellData(Boolean includeShellData) { *

                Deprecated. Use show_enum_origins.

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

                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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(GroupsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..6707eed86 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsRetrieveRequestRemoteFields { + public static final GroupsRetrieveRequestRemoteFields TYPE = + new GroupsRetrieveRequestRemoteFields(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + GroupsRetrieveRequestRemoteFields(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 GroupsRetrieveRequestRemoteFields + && this.string.equals(((GroupsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new GroupsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..9f4a16e4a --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/GroupsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class GroupsRetrieveRequestShowEnumOrigins { + public static final GroupsRetrieveRequestShowEnumOrigins TYPE = + new GroupsRetrieveRequestShowEnumOrigins(Value.TYPE, "type"); + + private final Value value; + + private final String string; + + GroupsRetrieveRequestShowEnumOrigins(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 GroupsRetrieveRequestShowEnumOrigins + && this.string.equals(((GroupsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TYPE: + return visitor.visitType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static GroupsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "type": + return TYPE; + default: + return new GroupsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/Issue.java b/src/main/java/com/merge/api/hris/types/Issue.java index 3b3ba8c9e..43500bdec 100644 --- a/src/main/java/com/merge/api/hris/types/Issue.java +++ b/src/main/java/com/merge/api/hris/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..f06917ab1 100644 --- a/src/main/java/com/merge/api/hris/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

                If provided, will only return issues whose first incident time was before this datetime.

                */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

                If true, will include muted issues

                */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

                If provided, will only return issues whose last incident time was before this datetime.

                */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

                If provided, will only include issues pertaining to the linked account passed in.

                */ diff --git a/src/main/java/com/merge/api/hris/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..495d18334 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} 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..0f973fdff 100644 --- a/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
              • filestorage - filestorage
              • *
              */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

              The pagination cursor value.

              */ diff --git a/src/main/java/com/merge/api/hris/types/Location.java b/src/main/java/com/merge/api/hris/types/Location.java index e597c959d..c0e1d72a6 100644 --- a/src/main/java/com/merge/api/hris/types/Location.java +++ b/src/main/java/com/merge/api/hris/types/Location.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,56 +132,77 @@ public Optional getModifiedAt() { /** * @return The location's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The location's phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return Line 1 of the location's street address. */ - @JsonProperty("street_1") + @JsonIgnore public Optional getStreet1() { + if (street1 == null) { + return Optional.empty(); + } return street1; } /** * @return Line 2 of the location's street address. */ - @JsonProperty("street_2") + @JsonIgnore public Optional getStreet2() { + if (street2 == null) { + return Optional.empty(); + } return street2; } /** * @return The location's city. */ - @JsonProperty("city") + @JsonIgnore public Optional getCity() { + if (city == null) { + return Optional.empty(); + } return city; } /** * @return The location's state. Represents a region if outside of the US. */ - @JsonProperty("state") + @JsonIgnore public Optional getState() { + if (state == null) { + return Optional.empty(); + } return state; } /** * @return The location's zip code or postal code. */ - @JsonProperty("zip_code") + @JsonIgnore public Optional getZipCode() { + if (zipCode == null) { + return Optional.empty(); + } return zipCode; } @@ -433,8 +460,11 @@ public Optional getZipCode() { *
            • ZW - Zimbabwe
            • *
            */ - @JsonProperty("country") + @JsonIgnore public Optional getCountry() { + if (country == null) { + return Optional.empty(); + } return country; } @@ -445,8 +475,11 @@ public Optional getCountry() { *
          • WORK - WORK
          • *
          */ - @JsonProperty("location_type") + @JsonIgnore public Optional getLocationType() { + if (locationType == null) { + return Optional.empty(); + } return locationType; } @@ -458,13 +491,91 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_1") + private Optional _getStreet1() { + return street1; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("street_2") + private Optional _getStreet2() { + return street2; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("city") + private Optional _getCity() { + return city; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("state") + private Optional _getState() { + return state; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("zip_code") + private Optional _getZipCode() { + return zipCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("country") + private Optional _getCountry() { + return country; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location_type") + private Optional _getLocationType() { + return locationType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -612,6 +723,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -654,6 +776,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The location's phone number.

          */ @@ -668,6 +801,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

          Line 1 of the location's street address.

          */ @@ -682,6 +826,17 @@ public Builder street1(String street1) { return this; } + public Builder street1(Nullable street1) { + if (street1.isNull()) { + this.street1 = null; + } else if (street1.isEmpty()) { + this.street1 = Optional.empty(); + } else { + this.street1 = Optional.of(street1.get()); + } + return this; + } + /** *

          Line 2 of the location's street address.

          */ @@ -696,6 +851,17 @@ public Builder street2(String street2) { return this; } + public Builder street2(Nullable street2) { + if (street2.isNull()) { + this.street2 = null; + } else if (street2.isEmpty()) { + this.street2 = Optional.empty(); + } else { + this.street2 = Optional.of(street2.get()); + } + return this; + } + /** *

          The location's city.

          */ @@ -710,6 +876,17 @@ public Builder city(String city) { return this; } + public Builder city(Nullable city) { + if (city.isNull()) { + this.city = null; + } else if (city.isEmpty()) { + this.city = Optional.empty(); + } else { + this.city = Optional.of(city.get()); + } + return this; + } + /** *

          The location's state. Represents a region if outside of the US.

          */ @@ -724,6 +901,17 @@ public Builder state(String state) { return this; } + public Builder state(Nullable state) { + if (state.isNull()) { + this.state = null; + } else if (state.isEmpty()) { + this.state = Optional.empty(); + } else { + this.state = Optional.of(state.get()); + } + return this; + } + /** *

          The location's zip code or postal code.

          */ @@ -738,6 +926,17 @@ public Builder zipCode(String zipCode) { return this; } + public Builder zipCode(Nullable zipCode) { + if (zipCode.isNull()) { + this.zipCode = null; + } else if (zipCode.isEmpty()) { + this.zipCode = Optional.empty(); + } else { + this.zipCode = Optional.of(zipCode.get()); + } + return this; + } + /** *

          The location's country.

          *
            @@ -1003,6 +1202,17 @@ public Builder country(LocationCountry country) { return this; } + public Builder country(Nullable country) { + if (country.isNull()) { + this.country = null; + } else if (country.isEmpty()) { + this.country = Optional.empty(); + } else { + this.country = Optional.of(country.get()); + } + return this; + } + /** *

            The location's type. Can be either WORK or HOME

            *
              @@ -1021,6 +1231,17 @@ public Builder locationType(LocationLocationType locationType) { return this; } + public Builder locationType(Nullable locationType) { + if (locationType.isNull()) { + this.locationType = null; + } else if (locationType.isEmpty()) { + this.locationType = Optional.empty(); + } else { + this.locationType = Optional.of(locationType.get()); + } + 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.

              */ @@ -1046,6 +1267,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -1057,6 +1289,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Location build() { return new Location( id, 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..11e62599e 100644 --- a/src/main/java/com/merge/api/hris/types/LocationsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/LocationsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -135,8 +138,11 @@ public Optional getIncludeShellData() { *
            • WORK - WORK
            • *
            */ - @JsonProperty("location_type") + @JsonIgnore public Optional getLocationType() { + if (locationType == null) { + return Optional.empty(); + } return locationType; } @@ -175,8 +181,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -188,6 +197,18 @@ public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("location_type") + private Optional _getLocationType() { + return locationType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -394,6 +415,17 @@ public Builder locationType(LocationsListRequestLocationType locationType) { return this; } + public Builder locationType(Nullable locationType) { + if (locationType.isNull()) { + this.locationType = null; + } else if (locationType.isEmpty()) { + this.locationType = Optional.empty(); + } else { + this.locationType = Optional.of(locationType.get()); + } + return this; + } + /** *

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

            */ @@ -464,6 +496,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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

            */ diff --git a/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java index 0018dd580..352305842 100644 --- a/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/hris/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -80,16 +83,34 @@ public Optional getEncoding() { /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -164,12 +185,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

            The MIME type of the file, if the field is for a file.

            */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +248,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +284,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java index b458679a2..7dcd1d8af 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java index b3b514397..dd27d554b 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java b/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java index 70677c999..fd17c6868 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedBankInfoList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedBankInfoList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java b/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java index 01f857d3c..82f3fe7a8 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedBenefitList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedBenefitList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java b/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java index 499995684..646236e75 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedCompanyList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCompanyList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java b/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java index 1082ccaae..539ed1742 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedDependentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedDependentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java index 29d01d731..1f6cdfff4 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployeeList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEmployeeList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java index 5542453a6..9dfb36ece 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployeePayrollRunList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEmployeePayrollRunList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java index c1c850910..360864891 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmployerBenefitList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEmployerBenefitList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java b/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java index 65c96a8de..d833ef3b3 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedEmploymentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedEmploymentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java b/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java index 9937b88cb..3b4bd6b94 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedGroupList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedGroupList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java b/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java index a1b1a45cb..5bede319c 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java b/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java index 2c780ba0d..717dbbb54 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedLocationList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedLocationList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java b/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java index b673f965f..9ccbd7d4d 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedPayGroupList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPayGroupList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java b/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java index d75077247..cc40ba2d6 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedPayrollRunList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedPayrollRunList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java index 502e22c3e..f0dd42045 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java b/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java index 2258a0dd6..588980da6 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTeamList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTeamList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java index 4b348368f..75b3ea2f8 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffBalanceList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTimeOffBalanceList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java index 3c24bf7bc..8549c5507 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimeOffList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTimeOffList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java b/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java index 52c8751e7..4414870f5 100644 --- a/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java +++ b/src/main/java/com/merge/api/hris/types/PaginatedTimesheetEntryList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTimesheetEntryList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/hris/types/PayGroup.java b/src/main/java/com/merge/api/hris/types/PayGroup.java index fdca41f94..593fcd14b 100644 --- a/src/main/java/com/merge/api/hris/types/PayGroup.java +++ b/src/main/java/com/merge/api/hris/types/PayGroup.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -70,8 +73,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -94,8 +100,11 @@ public Optional getModifiedAt() { /** * @return The pay group name. */ - @JsonProperty("pay_group_name") + @JsonIgnore public Optional getPayGroupName() { + if (payGroupName == null) { + return Optional.empty(); + } return payGroupName; } @@ -107,13 +116,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("pay_group_name") + private Optional _getPayGroupName() { + return payGroupName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -221,6 +260,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -263,6 +313,17 @@ public Builder payGroupName(String payGroupName) { return this; } + public Builder payGroupName(Nullable payGroupName) { + if (payGroupName.isNull()) { + this.payGroupName = null; + } else if (payGroupName.isEmpty()) { + this.payGroupName = Optional.empty(); + } else { + this.payGroupName = Optional.of(payGroupName.get()); + } + 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.

            */ @@ -288,6 +349,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -299,6 +371,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public PayGroup build() { return new PayGroup( id, 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..b5902d38e 100644 --- a/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayGroupsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public PayGroupsListRequest build() { return new PayGroupsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/hris/types/PayrollRun.java b/src/main/java/com/merge/api/hris/types/PayrollRun.java index 084ee9b72..21a2e3844 100644 --- a/src/main/java/com/merge/api/hris/types/PayrollRun.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRun.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -86,8 +89,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -117,8 +123,11 @@ public Optional getModifiedAt() { *
          • CLOSED - CLOSED
          • *
          */ - @JsonProperty("run_state") + @JsonIgnore public Optional getRunState() { + if (runState == null) { + return Optional.empty(); + } return runState; } @@ -132,32 +141,44 @@ public Optional getRunState() { *
        • SIGN_ON_BONUS - SIGN_ON_BONUS
        • *
        */ - @JsonProperty("run_type") + @JsonIgnore public Optional getRunType() { + if (runType == null) { + return Optional.empty(); + } return runType; } /** * @return The day and time the payroll run started. */ - @JsonProperty("start_date") + @JsonIgnore public Optional getStartDate() { + if (startDate == null) { + return Optional.empty(); + } return startDate; } /** * @return The day and time the payroll run ended. */ - @JsonProperty("end_date") + @JsonIgnore public Optional getEndDate() { + if (endDate == null) { + return Optional.empty(); + } return endDate; } /** * @return The day and time the payroll run was checked. */ - @JsonProperty("check_date") + @JsonIgnore public Optional getCheckDate() { + if (checkDate == null) { + return Optional.empty(); + } return checkDate; } @@ -169,13 +190,67 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("run_state") + private Optional _getRunState() { + return runState; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("run_type") + private Optional _getRunType() { + return runType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_date") + private Optional _getStartDate() { + return startDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_date") + private Optional _getEndDate() { + return endDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("check_date") + private Optional _getCheckDate() { + return checkDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -303,6 +378,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -352,6 +438,17 @@ public Builder runState(PayrollRunRunState runState) { return this; } + public Builder runState(Nullable runState) { + if (runState.isNull()) { + this.runState = null; + } else if (runState.isEmpty()) { + this.runState = Optional.empty(); + } else { + this.runState = Optional.of(runState.get()); + } + return this; + } + /** *

        The type of the payroll run

        *
          @@ -373,6 +470,17 @@ public Builder runType(PayrollRunRunType runType) { return this; } + public Builder runType(Nullable runType) { + if (runType.isNull()) { + this.runType = null; + } else if (runType.isEmpty()) { + this.runType = Optional.empty(); + } else { + this.runType = Optional.of(runType.get()); + } + return this; + } + /** *

          The day and time the payroll run started.

          */ @@ -387,6 +495,17 @@ public Builder startDate(OffsetDateTime startDate) { return this; } + public Builder startDate(Nullable startDate) { + if (startDate.isNull()) { + this.startDate = null; + } else if (startDate.isEmpty()) { + this.startDate = Optional.empty(); + } else { + this.startDate = Optional.of(startDate.get()); + } + return this; + } + /** *

          The day and time the payroll run ended.

          */ @@ -401,6 +520,17 @@ public Builder endDate(OffsetDateTime endDate) { return this; } + public Builder endDate(Nullable endDate) { + if (endDate.isNull()) { + this.endDate = null; + } else if (endDate.isEmpty()) { + this.endDate = Optional.empty(); + } else { + this.endDate = Optional.of(endDate.get()); + } + return this; + } + /** *

          The day and time the payroll run was checked.

          */ @@ -415,6 +545,17 @@ public Builder checkDate(OffsetDateTime checkDate) { return this; } + public Builder checkDate(Nullable checkDate) { + if (checkDate.isNull()) { + this.checkDate = null; + } else if (checkDate.isEmpty()) { + this.checkDate = Optional.empty(); + } else { + this.checkDate = Optional.of(checkDate.get()); + } + 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.

          */ @@ -440,6 +581,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -451,6 +603,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public PayrollRun build() { return new PayrollRun( id, 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..d1227a068 100644 --- a/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/PayrollRunsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -123,16 +126,22 @@ public Optional getCursor() { /** * @return If provided, will only return payroll runs ended after this datetime. */ - @JsonProperty("ended_after") + @JsonIgnore public Optional getEndedAfter() { + if (endedAfter == null) { + return Optional.empty(); + } return endedAfter; } /** * @return If provided, will only return payroll runs ended before this datetime. */ - @JsonProperty("ended_before") + @JsonIgnore public Optional getEndedBefore() { + if (endedBefore == null) { + return Optional.empty(); + } return endedBefore; } @@ -195,8 +204,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -210,8 +222,11 @@ public Optional getRemoteId() { *
        • SIGN_ON_BONUS - SIGN_ON_BONUS
        • *
        */ - @JsonProperty("run_type") + @JsonIgnore public Optional getRunType() { + if (runType == null) { + return Optional.empty(); + } return runType; } @@ -226,16 +241,58 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return payroll runs started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return payroll runs started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_after") + private Optional _getEndedAfter() { + return endedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_before") + private Optional _getEndedBefore() { + return endedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("run_type") + private Optional _getRunType() { + return runType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { return startedBefore; } @@ -419,6 +476,17 @@ public Builder endedAfter(OffsetDateTime endedAfter) { return this; } + public Builder endedAfter(Nullable endedAfter) { + if (endedAfter.isNull()) { + this.endedAfter = null; + } else if (endedAfter.isEmpty()) { + this.endedAfter = Optional.empty(); + } else { + this.endedAfter = Optional.of(endedAfter.get()); + } + return this; + } + /** *

        If provided, will only return payroll runs ended before this datetime.

        */ @@ -433,6 +501,17 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } + public Builder endedBefore(Nullable endedBefore) { + if (endedBefore.isNull()) { + this.endedBefore = null; + } else if (endedBefore.isEmpty()) { + this.endedBefore = Optional.empty(); + } else { + this.endedBefore = Optional.of(endedBefore.get()); + } + 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.

        */ @@ -545,6 +624,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        If provided, will only return PayrollRun's with this status. Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', 'SIGN_ON_BONUS')

        *
          @@ -566,6 +656,17 @@ public Builder runType(PayrollRunsListRequestRunType runType) { return this; } + public Builder runType(Nullable runType) { + if (runType.isNull()) { + this.runType = null; + } else if (runType.isEmpty()) { + this.runType = Optional.empty(); + } else { + this.runType = Optional.of(runType.get()); + } + 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

          */ @@ -594,6 +695,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

          If provided, will only return payroll runs started before this datetime.

          */ @@ -608,6 +720,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + public PayrollRunsListRequest build() { return new PayrollRunsListRequest( createdAfter, 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/RemoteFieldApi.java b/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java index 9714f4b0e..0a790d510 100644 --- a/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/hris/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); diff --git a/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java index 305c24a73..7be239edb 100644 --- a/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/hris/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/hris/types/Tax.java b/src/main/java/com/merge/api/hris/types/Tax.java index 378158c9d..c383e718e 100644 --- a/src/main/java/com/merge/api/hris/types/Tax.java +++ b/src/main/java/com/merge/api/hris/types/Tax.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -103,32 +109,44 @@ public Optional getModifiedAt() { return modifiedAt; } - @JsonProperty("employee_payroll_run") + @JsonIgnore public Optional getEmployeePayrollRun() { + if (employeePayrollRun == null) { + return Optional.empty(); + } return employeePayrollRun; } /** * @return The tax's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The tax amount. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } /** * @return Whether or not the employer is responsible for paying the tax. */ - @JsonProperty("employer_tax") + @JsonIgnore public Optional getEmployerTax() { + if (employerTax == null) { + return Optional.empty(); + } return employerTax; } @@ -140,13 +158,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_payroll_run") + private Optional _getEmployeePayrollRun() { + return employeePayrollRun; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employer_tax") + private Optional _getEmployerTax() { + return employerTax; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -269,6 +335,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -308,6 +385,17 @@ public Builder employeePayrollRun(String employeePayrollRun) { return this; } + public Builder employeePayrollRun(Nullable employeePayrollRun) { + if (employeePayrollRun.isNull()) { + this.employeePayrollRun = null; + } else if (employeePayrollRun.isEmpty()) { + this.employeePayrollRun = Optional.empty(); + } else { + this.employeePayrollRun = Optional.of(employeePayrollRun.get()); + } + return this; + } + /** *

          The tax's name.

          */ @@ -322,6 +410,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The tax amount.

          */ @@ -336,6 +435,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

          Whether or not the employer is responsible for paying the tax.

          */ @@ -350,6 +460,17 @@ public Builder employerTax(Boolean employerTax) { return this; } + public Builder employerTax(Nullable employerTax) { + if (employerTax.isNull()) { + this.employerTax = null; + } else if (employerTax.isEmpty()) { + this.employerTax = Optional.empty(); + } else { + this.employerTax = Optional.of(employerTax.get()); + } + 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.

          */ @@ -375,6 +496,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -386,6 +518,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Tax build() { return new Tax( id, diff --git a/src/main/java/com/merge/api/hris/types/Team.java b/src/main/java/com/merge/api/hris/types/Team.java index afbab9374..bd09fc6a5 100644 --- a/src/main/java/com/merge/api/hris/types/Team.java +++ b/src/main/java/com/merge/api/hris/types/Team.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,16 +104,22 @@ public Optional getModifiedAt() { /** * @return The team's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The team's parent team. */ - @JsonProperty("parent_team") + @JsonIgnore public Optional getParentTeam() { + if (parentTeam == null) { + return Optional.empty(); + } return parentTeam; } @@ -119,13 +131,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_team") + private Optional _getParentTeam() { + return parentTeam; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -238,6 +286,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -280,6 +339,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The team's parent team.

          */ @@ -294,6 +364,17 @@ public Builder parentTeam(TeamParentTeam parentTeam) { return this; } + public Builder parentTeam(Nullable parentTeam) { + if (parentTeam.isNull()) { + this.parentTeam = null; + } else if (parentTeam.isEmpty()) { + this.parentTeam = Optional.empty(); + } else { + this.parentTeam = Optional.of(parentTeam.get()); + } + 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.

          */ @@ -319,6 +400,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -330,6 +422,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Team build() { return new Team( id, 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..4e69142ad 100644 --- a/src/main/java/com/merge/api/hris/types/TeamsListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TeamsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TeamsListRequest.Builder.class) public final class TeamsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class TeamsListRequest { private final Map additionalProperties; private TeamsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private TeamsListRequest( * @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; } @@ -169,8 +172,17 @@ public Optional getParentTeamId() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +240,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 createdAfter = Optional.empty(); @@ -277,17 +289,17 @@ public Builder from(TeamsListRequest 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(TeamsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -446,6 +458,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TeamsListRequest build() { return new TeamsListRequest( expand, diff --git a/src/main/java/com/merge/api/hris/types/TeamsListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TeamsListRequestExpandItem.java new file mode 100644 index 000000000..91eb6e973 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TeamsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TeamsListRequestExpandItem { + public static final TeamsListRequestExpandItem PARENT_TEAM = + new TeamsListRequestExpandItem(Value.PARENT_TEAM, "parent_team"); + + private final Value value; + + private final String string; + + TeamsListRequestExpandItem(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 TeamsListRequestExpandItem + && this.string.equals(((TeamsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARENT_TEAM: + return visitor.visitParentTeam(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TeamsListRequestExpandItem valueOf(String value) { + switch (value) { + case "parent_team": + return PARENT_TEAM; + default: + return new TeamsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_TEAM, + + UNKNOWN + } + + public interface Visitor { + T visitParentTeam(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java index 572e950f2..9c8577aef 100644 --- a/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TeamsRetrieveRequest.Builder.class) public final class TeamsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class TeamsRetrieveRequest { private final Map additionalProperties; private TeamsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private TeamsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(TeamsRetrieveRequest 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(TeamsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..20a23ace6 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TeamsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TeamsRetrieveRequestExpandItem { + public static final TeamsRetrieveRequestExpandItem PARENT_TEAM = + new TeamsRetrieveRequestExpandItem(Value.PARENT_TEAM, "parent_team"); + + private final Value value; + + private final String string; + + TeamsRetrieveRequestExpandItem(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 TeamsRetrieveRequestExpandItem + && this.string.equals(((TeamsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PARENT_TEAM: + return visitor.visitParentTeam(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TeamsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "parent_team": + return PARENT_TEAM; + default: + return new TeamsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_TEAM, + + UNKNOWN + } + + public interface Visitor { + T visitParentTeam(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOff.java b/src/main/java/com/merge/api/hris/types/TimeOff.java index 8e6236ea9..04e5582c1 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOff.java +++ b/src/main/java/com/merge/api/hris/types/TimeOff.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -102,8 +105,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -126,16 +132,22 @@ public Optional getModifiedAt() { /** * @return The employee requesting time off. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The Merge ID of the employee with the ability to approve the time off request. */ - @JsonProperty("approver") + @JsonIgnore public Optional getApprover() { + if (approver == null) { + return Optional.empty(); + } return approver; } @@ -149,16 +161,22 @@ public Optional getApprover() { *
        • DELETED - DELETED
        • *
        */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The employee note for this time off request. */ - @JsonProperty("employee_note") + @JsonIgnore public Optional getEmployeeNote() { + if (employeeNote == null) { + return Optional.empty(); + } return employeeNote; } @@ -169,16 +187,22 @@ public Optional getEmployeeNote() { *
      • DAYS - DAYS
      • *
      */ - @JsonProperty("units") + @JsonIgnore public Optional getUnits() { + if (units == null) { + return Optional.empty(); + } return units; } /** * @return The time off quantity measured by the prescribed “units”. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } @@ -193,24 +217,33 @@ public Optional getAmount() { *
    • BEREAVEMENT - BEREAVEMENT
    • *
    */ - @JsonProperty("request_type") + @JsonIgnore public Optional getRequestType() { + if (requestType == null) { + return Optional.empty(); + } return requestType; } /** * @return The day and time of the start of the time requested off. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The day and time of the end of the time requested off. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } @@ -222,13 +255,91 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("approver") + private Optional _getApprover() { + return approver; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_note") + private Optional _getEmployeeNote() { + return employeeNote; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("units") + private Optional _getUnits() { + return units; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_type") + private Optional _getRequestType() { + return requestType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -376,6 +487,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    The datetime that this object was created by Merge.

    */ @@ -418,6 +540,17 @@ public Builder employee(TimeOffEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The Merge ID of the employee with the ability to approve the time off request.

    */ @@ -432,6 +565,17 @@ public Builder approver(TimeOffApprover approver) { return this; } + public Builder approver(Nullable approver) { + if (approver.isNull()) { + this.approver = null; + } else if (approver.isEmpty()) { + this.approver = Optional.empty(); + } else { + this.approver = Optional.of(approver.get()); + } + return this; + } + /** *

    The status of this time off request.

    *
      @@ -453,6 +597,17 @@ public Builder status(TimeOffStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The employee note for this time off request.

      */ @@ -467,6 +622,17 @@ public Builder employeeNote(String employeeNote) { return this; } + public Builder employeeNote(Nullable employeeNote) { + if (employeeNote.isNull()) { + this.employeeNote = null; + } else if (employeeNote.isEmpty()) { + this.employeeNote = Optional.empty(); + } else { + this.employeeNote = Optional.of(employeeNote.get()); + } + return this; + } + /** *

      The measurement that the third-party integration uses to count time requested.

      *
        @@ -485,6 +651,17 @@ public Builder units(TimeOffUnits units) { return this; } + public Builder units(Nullable units) { + if (units.isNull()) { + this.units = null; + } else if (units.isEmpty()) { + this.units = Optional.empty(); + } else { + this.units = Optional.of(units.get()); + } + return this; + } + /** *

        The time off quantity measured by the prescribed “units”.

        */ @@ -499,6 +676,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

        The type of time off request.

        *
          @@ -521,6 +709,17 @@ public Builder requestType(TimeOffRequestType requestType) { return this; } + public Builder requestType(Nullable requestType) { + if (requestType.isNull()) { + this.requestType = null; + } else if (requestType.isEmpty()) { + this.requestType = Optional.empty(); + } else { + this.requestType = Optional.of(requestType.get()); + } + return this; + } + /** *

          The day and time of the start of the time requested off.

          */ @@ -535,6 +734,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

          The day and time of the end of the time requested off.

          */ @@ -549,6 +759,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + 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.

          */ @@ -574,6 +795,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -585,6 +817,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public TimeOff build() { return new TimeOff( id, diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalance.java b/src/main/java/com/merge/api/hris/types/TimeOffBalance.java index 04c8f9a85..30536c747 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOffBalance.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalance.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,24 +112,33 @@ public Optional getModifiedAt() { /** * @return The employee the balance belongs to. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The current remaining PTO balance, measured in hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours. */ - @JsonProperty("balance") + @JsonIgnore public Optional getBalance() { + if (balance == null) { + return Optional.empty(); + } return balance; } /** * @return The amount of PTO used in terms of hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours. */ - @JsonProperty("used") + @JsonIgnore public Optional getUsed() { + if (used == null) { + return Optional.empty(); + } return used; } @@ -138,8 +153,11 @@ public Optional getUsed() { *
        • BEREAVEMENT - BEREAVEMENT
        • *
        */ - @JsonProperty("policy_type") + @JsonIgnore public Optional getPolicyType() { + if (policyType == null) { + return Optional.empty(); + } return policyType; } @@ -151,13 +169,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("balance") + private Optional _getBalance() { + return balance; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("used") + private Optional _getUsed() { + return used; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("policy_type") + private Optional _getPolicyType() { + return policyType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -280,6 +346,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -322,6 +399,17 @@ public Builder employee(TimeOffBalanceEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

        The current remaining PTO balance, measured in hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours.

        */ @@ -336,6 +424,17 @@ public Builder balance(Double balance) { return this; } + public Builder balance(Nullable balance) { + if (balance.isNull()) { + this.balance = null; + } else if (balance.isEmpty()) { + this.balance = Optional.empty(); + } else { + this.balance = Optional.of(balance.get()); + } + return this; + } + /** *

        The amount of PTO used in terms of hours. For integrations that return this value in days, Merge multiplies by 8 to calculate hours.

        */ @@ -350,6 +449,17 @@ public Builder used(Double used) { return this; } + public Builder used(Nullable used) { + if (used.isNull()) { + this.used = null; + } else if (used.isEmpty()) { + this.used = Optional.empty(); + } else { + this.used = Optional.of(used.get()); + } + return this; + } + /** *

        The policy type of this time off balance.

        *
          @@ -372,6 +482,17 @@ public Builder policyType(TimeOffBalancePolicyType policyType) { return this; } + public Builder policyType(Nullable policyType) { + if (policyType.isNull()) { + this.policyType = null; + } else if (policyType.isEmpty()) { + this.policyType = Optional.empty(); + } else { + this.policyType = Optional.of(policyType.get()); + } + 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.

          */ @@ -397,6 +518,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -408,6 +540,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public TimeOffBalance build() { return new TimeOffBalance( id, diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java index 5da15c592..f3477dd03 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimeOffBalancesListRequest.Builder.class) public final class TimeOffBalancesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -47,16 +50,16 @@ public final class TimeOffBalancesListRequest { private final Optional policyType; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private TimeOffBalancesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -68,9 +71,9 @@ private TimeOffBalancesListRequest( Optional modifiedBefore, Optional pageSize, Optional policyType, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.createdAfter = createdAfter; @@ -94,7 +97,7 @@ private TimeOffBalancesListRequest( * @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; } @@ -189,8 +192,11 @@ public Optional getPageSize() { *
        • BEREAVEMENT - BEREAVEMENT
        • *
        */ - @JsonProperty("policy_type") + @JsonIgnore public Optional getPolicyType() { + if (policyType == null) { + return Optional.empty(); + } return policyType; } @@ -198,15 +204,18 @@ public Optional getPolicyType() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -214,10 +223,22 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("policy_type") + private Optional _getPolicyType() { + return policyType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -278,7 +299,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 createdAfter = Optional.empty(); @@ -302,11 +323,11 @@ public static final class Builder { private Optional policyType = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -336,17 +357,17 @@ public Builder from(TimeOffBalancesListRequest 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(TimeOffBalancesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -513,16 +534,27 @@ public Builder policyType(TimeOffBalancesListRequestPolicyType policyType) { return this; } + public Builder policyType(Nullable policyType) { + if (policyType.isNull()) { + this.policyType = null; + } else if (policyType.isEmpty()) { + this.policyType = Optional.empty(); + } else { + this.policyType = Optional.of(policyType.get()); + } + return this; + } + /** *

        Deprecated. Use show_enum_origins.

        */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(TimeOffBalancesListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -541,16 +573,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(TimeOffBalancesListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestExpandItem.java new file mode 100644 index 000000000..b39d8ef5c --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesListRequestExpandItem { + public static final TimeOffBalancesListRequestExpandItem EMPLOYEE = + new TimeOffBalancesListRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + TimeOffBalancesListRequestExpandItem(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 TimeOffBalancesListRequestExpandItem + && this.string.equals(((TimeOffBalancesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesListRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new TimeOffBalancesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestRemoteFields.java new file mode 100644 index 000000000..d24284754 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesListRequestRemoteFields { + public static final TimeOffBalancesListRequestRemoteFields POLICY_TYPE = + new TimeOffBalancesListRequestRemoteFields(Value.POLICY_TYPE, "policy_type"); + + private final Value value; + + private final String string; + + TimeOffBalancesListRequestRemoteFields(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 TimeOffBalancesListRequestRemoteFields + && this.string.equals(((TimeOffBalancesListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POLICY_TYPE: + return visitor.visitPolicyType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesListRequestRemoteFields valueOf(String value) { + switch (value) { + case "policy_type": + return POLICY_TYPE; + default: + return new TimeOffBalancesListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + POLICY_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPolicyType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestShowEnumOrigins.java new file mode 100644 index 000000000..3a9fc2fca --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesListRequestShowEnumOrigins { + public static final TimeOffBalancesListRequestShowEnumOrigins POLICY_TYPE = + new TimeOffBalancesListRequestShowEnumOrigins(Value.POLICY_TYPE, "policy_type"); + + private final Value value; + + private final String string; + + TimeOffBalancesListRequestShowEnumOrigins(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 TimeOffBalancesListRequestShowEnumOrigins + && this.string.equals(((TimeOffBalancesListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POLICY_TYPE: + return visitor.visitPolicyType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "policy_type": + return POLICY_TYPE; + default: + return new TimeOffBalancesListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + POLICY_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPolicyType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java index a96cd1f06..ac5fa413f 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequest.java @@ -22,24 +22,24 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimeOffBalancesRetrieveRequest.Builder.class) public final class TimeOffBalancesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private TimeOffBalancesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -53,7 +53,7 @@ private TimeOffBalancesRetrieveRequest( * @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; } @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -125,15 +125,15 @@ 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(); private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -153,17 +153,17 @@ public Builder from(TimeOffBalancesRetrieveRequest 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(TimeOffBalancesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

        Deprecated. Use show_enum_origins.

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

        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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(TimeOffBalancesRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..a01b5e3d2 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesRetrieveRequestExpandItem { + public static final TimeOffBalancesRetrieveRequestExpandItem EMPLOYEE = + new TimeOffBalancesRetrieveRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + TimeOffBalancesRetrieveRequestExpandItem(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 TimeOffBalancesRetrieveRequestExpandItem + && this.string.equals(((TimeOffBalancesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new TimeOffBalancesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..00d147500 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesRetrieveRequestRemoteFields { + public static final TimeOffBalancesRetrieveRequestRemoteFields POLICY_TYPE = + new TimeOffBalancesRetrieveRequestRemoteFields(Value.POLICY_TYPE, "policy_type"); + + private final Value value; + + private final String string; + + TimeOffBalancesRetrieveRequestRemoteFields(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 TimeOffBalancesRetrieveRequestRemoteFields + && this.string.equals(((TimeOffBalancesRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POLICY_TYPE: + return visitor.visitPolicyType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "policy_type": + return POLICY_TYPE; + default: + return new TimeOffBalancesRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + POLICY_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPolicyType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..0e2fe7168 --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimeOffBalancesRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimeOffBalancesRetrieveRequestShowEnumOrigins { + public static final TimeOffBalancesRetrieveRequestShowEnumOrigins POLICY_TYPE = + new TimeOffBalancesRetrieveRequestShowEnumOrigins(Value.POLICY_TYPE, "policy_type"); + + private final Value value; + + private final String string; + + TimeOffBalancesRetrieveRequestShowEnumOrigins(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 TimeOffBalancesRetrieveRequestShowEnumOrigins + && this.string.equals(((TimeOffBalancesRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case POLICY_TYPE: + return visitor.visitPolicyType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimeOffBalancesRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "policy_type": + return POLICY_TYPE; + default: + return new TimeOffBalancesRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + POLICY_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitPolicyType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java index c4f160ec7..535e13018 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -165,16 +168,22 @@ public Optional getEmployeeId() { /** * @return If provided, will only return employees that ended after this datetime. */ - @JsonProperty("ended_after") + @JsonIgnore public Optional getEndedAfter() { + if (endedAfter == null) { + return Optional.empty(); + } return endedAfter; } /** * @return If provided, will only return time-offs that ended before this datetime. */ - @JsonProperty("ended_before") + @JsonIgnore public Optional getEndedBefore() { + if (endedBefore == null) { + return Optional.empty(); + } return endedBefore; } @@ -237,8 +246,11 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -253,8 +265,11 @@ public Optional getRemoteId() { *
      • BEREAVEMENT - BEREAVEMENT
      • *
      */ - @JsonProperty("request_type") + @JsonIgnore public Optional getRequestType() { + if (requestType == null) { + return Optional.empty(); + } return requestType; } @@ -269,16 +284,22 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return time-offs that started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return time-offs that started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } return startedBefore; } @@ -292,8 +313,53 @@ public Optional getStartedBefore() { *
    • DELETED - DELETED
    • *
    */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_after") + private Optional _getEndedAfter() { + return endedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_before") + private Optional _getEndedBefore() { + return endedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_type") + private Optional _getRequestType() { + return requestType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { return status; } @@ -544,6 +610,17 @@ public Builder endedAfter(OffsetDateTime endedAfter) { return this; } + public Builder endedAfter(Nullable endedAfter) { + if (endedAfter.isNull()) { + this.endedAfter = null; + } else if (endedAfter.isEmpty()) { + this.endedAfter = Optional.empty(); + } else { + this.endedAfter = Optional.of(endedAfter.get()); + } + return this; + } + /** *

    If provided, will only return time-offs that ended before this datetime.

    */ @@ -558,6 +635,17 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } + public Builder endedBefore(Nullable endedBefore) { + if (endedBefore.isNull()) { + this.endedBefore = null; + } else if (endedBefore.isEmpty()) { + this.endedBefore = Optional.empty(); + } else { + this.endedBefore = Optional.of(endedBefore.get()); + } + 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.

    */ @@ -670,6 +758,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

    If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT')

    *
      @@ -692,6 +791,17 @@ public Builder requestType(TimeOffListRequestRequestType requestType) { return this; } + public Builder requestType(Nullable requestType) { + if (requestType.isNull()) { + this.requestType = null; + } else if (requestType.isEmpty()) { + this.requestType = Optional.empty(); + } else { + this.requestType = Optional.of(requestType.get()); + } + 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

      */ @@ -720,6 +830,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

      If provided, will only return time-offs that started before this datetime.

      */ @@ -734,6 +855,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + /** *

      If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED')

      *
        @@ -755,6 +887,17 @@ public Builder status(TimeOffListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + public TimeOffListRequest build() { return new TimeOffListRequest( expand, diff --git a/src/main/java/com/merge/api/hris/types/TimeOffRequest.java b/src/main/java/com/merge/api/hris/types/TimeOffRequest.java index 3b78fe2cb..c552ec09d 100644 --- a/src/main/java/com/merge/api/hris/types/TimeOffRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimeOffRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -76,16 +79,22 @@ private TimeOffRequest( /** * @return The employee requesting time off. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The Merge ID of the employee with the ability to approve the time off request. */ - @JsonProperty("approver") + @JsonIgnore public Optional getApprover() { + if (approver == null) { + return Optional.empty(); + } return approver; } @@ -99,16 +108,22 @@ public Optional getApprover() { *
      • DELETED - DELETED
      • *
      */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The employee note for this time off request. */ - @JsonProperty("employee_note") + @JsonIgnore public Optional getEmployeeNote() { + if (employeeNote == null) { + return Optional.empty(); + } return employeeNote; } @@ -119,16 +134,22 @@ public Optional getEmployeeNote() { *
    • DAYS - DAYS
    • *
    */ - @JsonProperty("units") + @JsonIgnore public Optional getUnits() { + if (units == null) { + return Optional.empty(); + } return units; } /** * @return The time off quantity measured by the prescribed “units”. */ - @JsonProperty("amount") + @JsonIgnore public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } return amount; } @@ -143,34 +164,115 @@ public Optional getAmount() { *
  • BEREAVEMENT - BEREAVEMENT
  • * */ - @JsonProperty("request_type") + @JsonIgnore public Optional getRequestType() { + if (requestType == null) { + return Optional.empty(); + } return requestType; } /** * @return The day and time of the start of the time requested off. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The day and time of the end of the time requested off. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("approver") + private Optional _getApprover() { + return approver; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee_note") + private Optional _getEmployeeNote() { + return employeeNote; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("units") + private Optional _getUnits() { + return units; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_type") + private Optional _getRequestType() { + return requestType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -282,6 +384,17 @@ public Builder employee(TimeOffRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

    The Merge ID of the employee with the ability to approve the time off request.

    */ @@ -296,6 +409,17 @@ public Builder approver(TimeOffRequestApprover approver) { return this; } + public Builder approver(Nullable approver) { + if (approver.isNull()) { + this.approver = null; + } else if (approver.isEmpty()) { + this.approver = Optional.empty(); + } else { + this.approver = Optional.of(approver.get()); + } + return this; + } + /** *

    The status of this time off request.

    *
      @@ -317,6 +441,17 @@ public Builder status(TimeOffRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

      The employee note for this time off request.

      */ @@ -331,6 +466,17 @@ public Builder employeeNote(String employeeNote) { return this; } + public Builder employeeNote(Nullable employeeNote) { + if (employeeNote.isNull()) { + this.employeeNote = null; + } else if (employeeNote.isEmpty()) { + this.employeeNote = Optional.empty(); + } else { + this.employeeNote = Optional.of(employeeNote.get()); + } + return this; + } + /** *

      The measurement that the third-party integration uses to count time requested.

      *
        @@ -349,6 +495,17 @@ public Builder units(TimeOffRequestUnits units) { return this; } + public Builder units(Nullable units) { + if (units.isNull()) { + this.units = null; + } else if (units.isEmpty()) { + this.units = Optional.empty(); + } else { + this.units = Optional.of(units.get()); + } + return this; + } + /** *

        The time off quantity measured by the prescribed “units”.

        */ @@ -363,6 +520,17 @@ public Builder amount(Double amount) { return this; } + public Builder amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + /** *

        The type of time off request.

        *
          @@ -385,6 +553,17 @@ public Builder requestType(TimeOffRequestRequestType requestType) { return this; } + public Builder requestType(Nullable requestType) { + if (requestType.isNull()) { + this.requestType = null; + } else if (requestType.isEmpty()) { + this.requestType = Optional.empty(); + } else { + this.requestType = Optional.of(requestType.get()); + } + return this; + } + /** *

          The day and time of the start of the time requested off.

          */ @@ -399,6 +578,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

          The day and time of the end of the time requested off.

          */ @@ -413,6 +603,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -424,6 +625,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -435,6 +647,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public TimeOffRequest build() { return new TimeOffRequest( employee, 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..a57c6f717 100644 --- a/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimesheetEntriesListRequest.Builder.class) public final class TimesheetEntriesListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -60,7 +63,7 @@ public final class TimesheetEntriesListRequest { private final Map additionalProperties; private TimesheetEntriesListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -102,7 +105,7 @@ private TimesheetEntriesListRequest( * @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; } @@ -141,16 +144,22 @@ public Optional getEmployeeId() { /** * @return If provided, will only return timesheet entries ended after this datetime. */ - @JsonProperty("ended_after") + @JsonIgnore public Optional getEndedAfter() { + if (endedAfter == null) { + return Optional.empty(); + } return endedAfter; } /** * @return If provided, will only return timesheet entries ended before this datetime. */ - @JsonProperty("ended_before") + @JsonIgnore public Optional getEndedBefore() { + if (endedBefore == null) { + return Optional.empty(); + } return endedBefore; } @@ -213,24 +222,63 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return timesheet entries started after this datetime. */ - @JsonProperty("started_after") + @JsonIgnore public Optional getStartedAfter() { + if (startedAfter == null) { + return Optional.empty(); + } return startedAfter; } /** * @return If provided, will only return timesheet entries started before this datetime. */ - @JsonProperty("started_before") + @JsonIgnore public Optional getStartedBefore() { + if (startedBefore == null) { + return Optional.empty(); + } + return startedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_after") + private Optional _getEndedAfter() { + return endedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ended_before") + private Optional _getEndedBefore() { + return endedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_after") + private Optional _getStartedAfter() { + return startedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("started_before") + private Optional _getStartedBefore() { return startedBefore; } @@ -298,7 +346,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 createdAfter = Optional.empty(); @@ -362,17 +410,17 @@ public Builder from(TimesheetEntriesListRequest 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(TimesheetEntriesListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -447,6 +495,17 @@ public Builder endedAfter(OffsetDateTime endedAfter) { return this; } + public Builder endedAfter(Nullable endedAfter) { + if (endedAfter.isNull()) { + this.endedAfter = null; + } else if (endedAfter.isEmpty()) { + this.endedAfter = Optional.empty(); + } else { + this.endedAfter = Optional.of(endedAfter.get()); + } + return this; + } + /** *

          If provided, will only return timesheet entries ended before this datetime.

          */ @@ -461,6 +520,17 @@ public Builder endedBefore(OffsetDateTime endedBefore) { return this; } + public Builder endedBefore(Nullable endedBefore) { + if (endedBefore.isNull()) { + this.endedBefore = null; + } else if (endedBefore.isEmpty()) { + this.endedBefore = Optional.empty(); + } else { + this.endedBefore = Optional.of(endedBefore.get()); + } + 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.

          */ @@ -573,6 +643,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          If provided, will only return timesheet entries started after this datetime.

          */ @@ -587,6 +668,17 @@ public Builder startedAfter(OffsetDateTime startedAfter) { return this; } + public Builder startedAfter(Nullable startedAfter) { + if (startedAfter.isNull()) { + this.startedAfter = null; + } else if (startedAfter.isEmpty()) { + this.startedAfter = Optional.empty(); + } else { + this.startedAfter = Optional.of(startedAfter.get()); + } + return this; + } + /** *

          If provided, will only return timesheet entries started before this datetime.

          */ @@ -601,6 +693,17 @@ public Builder startedBefore(OffsetDateTime startedBefore) { return this; } + public Builder startedBefore(Nullable startedBefore) { + if (startedBefore.isNull()) { + this.startedBefore = null; + } else if (startedBefore.isEmpty()) { + this.startedBefore = Optional.empty(); + } else { + this.startedBefore = Optional.of(startedBefore.get()); + } + return this; + } + public TimesheetEntriesListRequest build() { return new TimesheetEntriesListRequest( expand, diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestExpandItem.java new file mode 100644 index 000000000..64a858ccc --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimesheetEntriesListRequestExpandItem { + public static final TimesheetEntriesListRequestExpandItem EMPLOYEE = + new TimesheetEntriesListRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + TimesheetEntriesListRequestExpandItem(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 TimesheetEntriesListRequestExpandItem + && this.string.equals(((TimesheetEntriesListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimesheetEntriesListRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new TimesheetEntriesListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java index 327be765e..41f537f85 100644 --- a/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = TimesheetEntriesRetrieveRequest.Builder.class) public final class TimesheetEntriesRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class TimesheetEntriesRetrieveRequest { private final Map additionalProperties; private TimesheetEntriesRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private TimesheetEntriesRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(TimesheetEntriesRetrieveRequest 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(TimesheetEntriesRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequestExpandItem.java new file mode 100644 index 000000000..0b9c46cae --- /dev/null +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntriesRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.merge.api.hris.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class TimesheetEntriesRetrieveRequestExpandItem { + public static final TimesheetEntriesRetrieveRequestExpandItem EMPLOYEE = + new TimesheetEntriesRetrieveRequestExpandItem(Value.EMPLOYEE, "employee"); + + private final Value value; + + private final String string; + + TimesheetEntriesRetrieveRequestExpandItem(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 TimesheetEntriesRetrieveRequestExpandItem + && this.string.equals(((TimesheetEntriesRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EMPLOYEE: + return visitor.visitEmployee(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static TimesheetEntriesRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "employee": + return EMPLOYEE; + default: + return new TimesheetEntriesRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + EMPLOYEE, + + UNKNOWN + } + + public interface Visitor { + T visitEmployee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntry.java b/src/main/java/com/merge/api/hris/types/TimesheetEntry.java index c7ccfdca9..5e7709d0e 100644 --- a/src/main/java/com/merge/api/hris/types/TimesheetEntry.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntry.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -82,8 +85,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -106,32 +112,44 @@ public Optional getModifiedAt() { /** * @return The employee the timesheet entry is for. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The number of hours logged by the employee. */ - @JsonProperty("hours_worked") + @JsonIgnore public Optional getHoursWorked() { + if (hoursWorked == null) { + return Optional.empty(); + } return hoursWorked; } /** * @return The time at which the employee started work. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The time at which the employee ended work. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } @@ -143,13 +161,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hours_worked") + private Optional _getHoursWorked() { + return hoursWorked; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -272,6 +338,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -314,6 +391,17 @@ public Builder employee(TimesheetEntryEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

          The number of hours logged by the employee.

          */ @@ -328,6 +416,17 @@ public Builder hoursWorked(Double hoursWorked) { return this; } + public Builder hoursWorked(Nullable hoursWorked) { + if (hoursWorked.isNull()) { + this.hoursWorked = null; + } else if (hoursWorked.isEmpty()) { + this.hoursWorked = Optional.empty(); + } else { + this.hoursWorked = Optional.of(hoursWorked.get()); + } + return this; + } + /** *

          The time at which the employee started work.

          */ @@ -342,6 +441,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

          The time at which the employee ended work.

          */ @@ -356,6 +466,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + 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,6 +502,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -392,6 +524,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public TimesheetEntry build() { return new TimesheetEntry( id, diff --git a/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java index 9c289d6b6..b8a9b0b7d 100644 --- a/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java +++ b/src/main/java/com/merge/api/hris/types/TimesheetEntryRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -56,42 +59,96 @@ private TimesheetEntryRequest( /** * @return The employee the timesheet entry is for. */ - @JsonProperty("employee") + @JsonIgnore public Optional getEmployee() { + if (employee == null) { + return Optional.empty(); + } return employee; } /** * @return The number of hours logged by the employee. */ - @JsonProperty("hours_worked") + @JsonIgnore public Optional getHoursWorked() { + if (hoursWorked == null) { + return Optional.empty(); + } return hoursWorked; } /** * @return The time at which the employee started work. */ - @JsonProperty("start_time") + @JsonIgnore public Optional getStartTime() { + if (startTime == null) { + return Optional.empty(); + } return startTime; } /** * @return The time at which the employee ended work. */ - @JsonProperty("end_time") + @JsonIgnore public Optional getEndTime() { + if (endTime == null) { + return Optional.empty(); + } return endTime; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("employee") + private Optional _getEmployee() { + return employee; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hours_worked") + private Optional _getHoursWorked() { + return hoursWorked; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("start_time") + private Optional _getStartTime() { + return startTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("end_time") + private Optional _getEndTime() { + return endTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -178,6 +235,17 @@ public Builder employee(TimesheetEntryRequestEmployee employee) { return this; } + public Builder employee(Nullable employee) { + if (employee.isNull()) { + this.employee = null; + } else if (employee.isEmpty()) { + this.employee = Optional.empty(); + } else { + this.employee = Optional.of(employee.get()); + } + return this; + } + /** *

          The number of hours logged by the employee.

          */ @@ -192,6 +260,17 @@ public Builder hoursWorked(Double hoursWorked) { return this; } + public Builder hoursWorked(Nullable hoursWorked) { + if (hoursWorked.isNull()) { + this.hoursWorked = null; + } else if (hoursWorked.isEmpty()) { + this.hoursWorked = Optional.empty(); + } else { + this.hoursWorked = Optional.of(hoursWorked.get()); + } + return this; + } + /** *

          The time at which the employee started work.

          */ @@ -206,6 +285,17 @@ public Builder startTime(OffsetDateTime startTime) { return this; } + public Builder startTime(Nullable startTime) { + if (startTime.isNull()) { + this.startTime = null; + } else if (startTime.isEmpty()) { + this.startTime = Optional.empty(); + } else { + this.startTime = Optional.of(startTime.get()); + } + return this; + } + /** *

          The time at which the employee ended work.

          */ @@ -220,6 +310,17 @@ public Builder endTime(OffsetDateTime endTime) { return this; } + public Builder endTime(Nullable endTime) { + if (endTime.isNull()) { + this.endTime = null; + } else if (endTime.isEmpty()) { + this.endTime = Optional.empty(); + } else { + this.endTime = Optional.of(endTime.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -231,6 +332,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -242,6 +354,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public TimesheetEntryRequest build() { return new TimesheetEntryRequest( employee, diff --git a/src/main/java/com/merge/api/ticketing/AccountTokenClient.java b/src/main/java/com/merge/api/ticketing/AccountTokenClient.java index 05b012dc0..36edb587f 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.AccountTokenRetrieveRequest; public class AccountTokenClient { protected final ClientOptions clientOptions; @@ -34,7 +35,15 @@ public AccountToken retrieve(String publicToken) { /** * 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(); + public AccountToken retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).body(); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public AccountToken retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, 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..1b9ec4c3c 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.AccountTokenRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncAccountTokenClient { @@ -35,7 +36,15 @@ public CompletableFuture retrieve(String publicToken) { /** * 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()); + public CompletableFuture retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return this.rawClient.retrieve(publicToken, request).thenApply(response -> response.body()); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(publicToken, request, requestOptions).thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java b/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java index 2672c20f5..ec481a6c0 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncAsyncPassthroughClient.java @@ -6,6 +6,7 @@ import com.merge.api.core.ClientOptions; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ticketing.types.DataPassthroughRequest; import java.util.concurrent.CompletableFuture; @@ -53,9 +54,17 @@ public CompletableFuture retrieve(String async * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return this.rawClient.retrieve(asyncPassthroughReceiptId, request).thenApply(response -> response.body()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { return this.rawClient - .retrieve(asyncPassthroughReceiptId, requestOptions) + .retrieve(asyncPassthroughReceiptId, request, requestOptions) .thenApply(response -> response.body()); } } diff --git a/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java b/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java index 91f35faaa..1ac514c5b 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncFieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsDestroyRequest; import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; import com.merge.api.ticketing.types.RemoteFieldApiResponse; @@ -81,9 +82,17 @@ public CompletableFuture fieldMappingsDestroy(Stri * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .thenApply(response -> response.body()); } diff --git a/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java b/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java index ce384203c..22af206ea 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncIssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.Issue; import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.IssuesRetrieveRequest; import java.util.concurrent.CompletableFuture; public class AsyncIssuesClient { @@ -58,7 +59,14 @@ public CompletableFuture retrieve(String id) { /** * Get a specific issue. */ - public CompletableFuture retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..8dc7c4022 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.AccountTokenRetrieveRequest; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -33,25 +34,33 @@ public AsyncRawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ public CompletableFuture> retrieve( - String publicToken, RequestOptions requestOptions) { + String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public CompletableFuture> retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -61,18 +70,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(), AccountToken.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response)); return; } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); future.completeExceptionally(new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); + "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..4d099ed6e 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAccountsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,10 +120,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -132,7 +132,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -144,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)); @@ -213,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(), 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..b4815557d 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ticketing.types.DataPassthroughRequest; import java.io.IOException; @@ -73,19 +74,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)); @@ -105,25 +103,35 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> retrieve( String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public CompletableFuture> retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); } /** * Retrieves data from earlier async-passthrough POST request */ public CompletableFuture> retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -133,19 +141,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..021e57fda 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAttachmentsClient.java @@ -24,10 +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; import okhttp3.Call; @@ -147,10 +144,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedAttachmentList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AttachmentsListRequest nextRequest = AttachmentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -158,7 +156,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -170,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)); @@ -214,12 +209,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 +232,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 +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(), 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 +386,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 +433,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..fff0bd8d6 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -99,10 +98,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -110,7 +110,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -122,12 +122,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..1c35bb626 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCollectionsClient.java @@ -21,7 +21,6 @@ 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; @@ -152,10 +151,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedCollectionList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCollectionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CollectionsListRequest nextRequest = CollectionsListRequest.builder() .from(request) .cursor(startingAfter) @@ -163,7 +163,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -175,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)); @@ -265,35 +262,32 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.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 viewersList(collectionId, nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { + try { + return viewersList(collectionId, 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)); @@ -369,18 +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(), 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..8e21dbac9 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawCommentsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -143,10 +140,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCommentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CommentsListRequest nextRequest = CommentsListRequest.builder() .from(request) .cursor(startingAfter) @@ -154,7 +152,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -166,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)); @@ -209,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); } @@ -234,18 +227,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 +304,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 +357,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..9458d0765 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawContactsClient.java @@ -21,10 +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; import okhttp3.Call; @@ -136,10 +133,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) @@ -147,7 +145,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -159,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)); @@ -203,12 +198,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 +221,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 +298,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 +351,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..7b271d412 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsDestroyRequest; import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; 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 +86,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 +134,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 +157,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)); @@ -199,25 +187,34 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { */ public CompletableFuture> fieldMappingsDestroy( String fieldMappingId) { - return fieldMappingsDestroy(fieldMappingId, null); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -227,19 +224,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)); @@ -304,19 +299,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 +373,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 +428,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..ed4bf4e70 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.Issue; import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.IssuesRetrieveRequest; import com.merge.api.ticketing.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; @@ -145,17 +145,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -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)); @@ -191,24 +189,32 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Get a specific issue. */ public CompletableFuture> retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public CompletableFuture> retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { + public CompletableFuture> retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -218,17 +224,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..901d5b546 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkTokenClient.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(), 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..02477aaf3 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -138,10 +137,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -150,7 +150,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -162,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)); 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..779c2e662 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawProjectsClient.java @@ -21,7 +21,6 @@ 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; @@ -124,10 +123,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ProjectsListRequest nextRequest = ProjectsListRequest.builder() .from(request) .cursor(startingAfter) @@ -135,7 +135,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -147,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,17 +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(), 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,17 +306,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return usersList(parentId, nextRequest, requestOptions) .get() @@ -333,12 +329,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..4cc89842a 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawRolesClient.java @@ -18,7 +18,6 @@ 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; @@ -121,17 +120,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRoleList.class); + String startingAfter = parsedResponse.getNext().orElse(null); RolesListRequest nextRequest = RolesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -143,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)); @@ -212,17 +209,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..6fab4bd5e 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -82,10 +81,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + PaginatedSyncStatusList parsedResponse = + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); SyncStatusListRequest nextRequest = SyncStatusListRequest.builder() .from(request) .cursor(startingAfter) @@ -93,7 +93,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -105,12 +105,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..078b32bd4 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTagsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,17 +120,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -143,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)); @@ -212,17 +209,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..bc61236eb 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTeamsClient.java @@ -18,7 +18,6 @@ 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; @@ -121,17 +120,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -143,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)); @@ -212,17 +209,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..b92718195 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawTicketsClient.java @@ -22,6 +22,7 @@ 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.TicketsMetaPatchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; @@ -29,10 +30,7 @@ import com.merge.api.ticketing.types.Viewer; 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; import okhttp3.Call; @@ -251,35 +249,32 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTicketList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsListRequest nextRequest = TicketsListRequest.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); - } - }), + new SyncPagingIterable(!startingAfter.isEmpty(), 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)); @@ -317,12 +312,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 +335,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 +427,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 +475,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 +498,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,35 +592,32 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsViewersListRequest nextRequest = TicketsViewersListRequest.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 viewersList(ticketId, nextRequest, requestOptions) - .get() - .body(); - } catch (InterruptedException | ExecutionException e) { - throw new RuntimeException(e); - } - }), + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { + try { + return viewersList(ticketId, 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)); @@ -654,25 +636,33 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { * Returns metadata for Ticket PATCHs. */ public CompletableFuture> metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, TicketsMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Ticket PATCHs. */ public CompletableFuture> metaPatchRetrieve( - String id, RequestOptions requestOptions) { + String id, TicketsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture> metaPatchRetrieve( + String id, TicketsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/tickets/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); @@ -682,18 +672,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 +741,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,10 +844,11 @@ public CompletableFuture startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsRemoteFieldClassesListRequest nextRequest = TicketsRemoteFieldClassesListRequest.builder() .from(request) @@ -873,7 +858,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO parsedResponse.getResults().orElse(Collections.emptyList()); future.complete(new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> { + !startingAfter.isEmpty(), result, parsedResponse, () -> { try { return remoteFieldClassesList(nextRequest, requestOptions) .get() @@ -885,12 +870,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..8d0fa629d 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncRawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -133,17 +132,18 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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, () -> { + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> { try { return list(nextRequest, requestOptions) .get() @@ -155,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,17 +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(), 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..4dd07dcb5 100644 --- a/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/AsyncTicketsClient.java @@ -13,6 +13,7 @@ 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.TicketsMetaPatchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; @@ -143,8 +144,16 @@ public CompletableFuture metaPatchRetrieve(String id) { /** * Returns metadata for Ticket PATCHs. */ - public CompletableFuture metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).thenApply(response -> response.body()); + public CompletableFuture metaPatchRetrieve(String id, TicketsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).thenApply(response -> response.body()); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public CompletableFuture metaPatchRetrieve( + String id, TicketsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).thenApply(response -> response.body()); } /** diff --git a/src/main/java/com/merge/api/ticketing/FieldMappingClient.java b/src/main/java/com/merge/api/ticketing/FieldMappingClient.java index 38a8ea491..7a6e8fe41 100644 --- a/src/main/java/com/merge/api/ticketing/FieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/FieldMappingClient.java @@ -9,6 +9,7 @@ import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsDestroyRequest; import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; import com.merge.api.ticketing.types.RemoteFieldApiResponse; @@ -78,9 +79,18 @@ public FieldMappingInstanceResponse fieldMappingsDestroy(String fieldMappingId) /** * 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) { + public FieldMappingInstanceResponse fieldMappingsDestroy( + String fieldMappingId, FieldMappingsDestroyRequest request) { + return this.rawClient.fieldMappingsDestroy(fieldMappingId, request).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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { return this.rawClient - .fieldMappingsDestroy(fieldMappingId, requestOptions) + .fieldMappingsDestroy(fieldMappingId, request, requestOptions) .body(); } diff --git a/src/main/java/com/merge/api/ticketing/IssuesClient.java b/src/main/java/com/merge/api/ticketing/IssuesClient.java index e6dcf1db9..5df1940a4 100644 --- a/src/main/java/com/merge/api/ticketing/IssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/IssuesClient.java @@ -8,6 +8,7 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.Issue; import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.IssuesRetrieveRequest; public class IssuesClient { protected final ClientOptions clientOptions; @@ -57,7 +58,14 @@ public Issue retrieve(String id) { /** * Get a specific issue. */ - public Issue retrieve(String id, RequestOptions requestOptions) { - return this.rawClient.retrieve(id, requestOptions).body(); + public Issue retrieve(String id, IssuesRetrieveRequest request) { + return this.rawClient.retrieve(id, request).body(); + } + + /** + * Get a specific issue. + */ + public Issue retrieve(String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.retrieve(id, 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..e2b3e9767 100644 --- a/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAccountTokenClient.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.AccountTokenRetrieveRequest; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -29,40 +30,45 @@ public RawAccountTokenClient(ClientOptions clientOptions) { * Returns the account token for the end user with the provided public token. */ public MergeApiHttpResponse retrieve(String publicToken) { - return retrieve(publicToken, null); + return retrieve(publicToken, AccountTokenRetrieveRequest.builder().build()); } /** * Returns the account token for the end user with the provided public token. */ - public MergeApiHttpResponse retrieve(String publicToken, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve(String publicToken, AccountTokenRetrieveRequest request) { + return retrieve(publicToken, request, null); + } + + /** + * Returns the account token for the end user with the provided public token. + */ + public MergeApiHttpResponse retrieve( + String publicToken, AccountTokenRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/account-token") .addPathSegment(publicToken) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), AccountToken.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, AccountToken.class), response); } - String responseBodyString = responseBody != null ? responseBody.string() : "{}"; - throw new ApiError( - "Error with status code " + response.code(), - response.code(), - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response); + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw 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..9d62bb925 100644 --- a/src/main/java/com/merge/api/ticketing/RawAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAccountsClient.java @@ -18,7 +18,6 @@ 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; @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAccountList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AccountsListRequest nextRequest = AccountsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -185,16 +181,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..cb00b4b18 100644 --- a/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAsyncPassthroughClient.java @@ -12,6 +12,7 @@ import com.merge.api.core.ObjectMappers; import com.merge.api.core.RequestOptions; import com.merge.api.ticketing.types.AsyncPassthroughReciept; +import com.merge.api.ticketing.types.AsyncPassthroughRetrieveRequest; import com.merge.api.ticketing.types.AsyncPassthroughRetrieveResponse; import com.merge.api.ticketing.types.DataPassthroughRequest; import java.io.IOException; @@ -66,17 +67,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); } @@ -86,43 +84,49 @@ public MergeApiHttpResponse create( * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve(String asyncPassthroughReceiptId) { - return retrieve(asyncPassthroughReceiptId, null); + return retrieve( + asyncPassthroughReceiptId, + AsyncPassthroughRetrieveRequest.builder().build()); } /** * Retrieves data from earlier async-passthrough POST request */ public MergeApiHttpResponse retrieve( - String asyncPassthroughReceiptId, RequestOptions requestOptions) { + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request) { + return retrieve(asyncPassthroughReceiptId, request, null); + } + + /** + * Retrieves data from earlier async-passthrough POST request + */ + public MergeApiHttpResponse retrieve( + String asyncPassthroughReceiptId, AsyncPassthroughRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/async-passthrough") .addPathSegment(asyncPassthroughReceiptId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..01355d7bc 100644 --- a/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAttachmentsClient.java @@ -24,10 +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; import okhttp3.OkHttpClient; @@ -138,28 +135,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAttachmentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -188,12 +181,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 +201,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 +264,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 +324,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 +358,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..e900a0581 100644 --- a/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java +++ b/src/main/java/com/merge/api/ticketing/RawAuditTrailClient.java @@ -17,7 +17,6 @@ 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; @@ -90,10 +89,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedAuditLogEventList.class); + String startingAfter = parsedResponse.getNext().orElse(null); AuditTrailListRequest nextRequest = AuditTrailListRequest.builder() .from(request) .cursor(startingAfter) @@ -101,17 +101,13 @@ public MergeApiHttpResponse> list( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..e9fe297a6 100644 --- a/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawCollectionsClient.java @@ -21,7 +21,6 @@ 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; @@ -143,28 +142,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCollectionList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CollectionsListRequest nextRequest = CollectionsListRequest.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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -237,10 +232,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CollectionsViewersListRequest nextRequest = CollectionsViewersListRequest.builder() .from(request) .cursor(startingAfter) @@ -248,17 +244,13 @@ public MergeApiHttpResponse> viewersList( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> viewersList( + !startingAfter.isEmpty(), result, parsedResponse, () -> viewersList( collectionId, 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); } @@ -322,16 +314,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..47ffb62e2 100644 --- a/src/main/java/com/merge/api/ticketing/RawCommentsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawCommentsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -135,27 +132,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedCommentList.class); + String startingAfter = parsedResponse.getNext().orElse(null); CommentsListRequest nextRequest = CommentsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -183,12 +177,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 +197,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 +259,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 +298,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..869f322a6 100644 --- a/src/main/java/com/merge/api/ticketing/RawContactsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawContactsClient.java @@ -21,10 +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; import okhttp3.OkHttpClient; @@ -128,27 +125,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedContactList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ContactsListRequest nextRequest = ContactsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -177,12 +171,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 +191,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 +254,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 +293,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..e4dcea9d4 100644 --- a/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java +++ b/src/main/java/com/merge/api/ticketing/RawFieldMappingClient.java @@ -16,13 +16,12 @@ import com.merge.api.ticketing.types.ExternalTargetFieldApiResponse; import com.merge.api.ticketing.types.FieldMappingApiInstanceResponse; import com.merge.api.ticketing.types.FieldMappingInstanceResponse; +import com.merge.api.ticketing.types.FieldMappingsDestroyRequest; import com.merge.api.ticketing.types.FieldMappingsRetrieveRequest; import com.merge.api.ticketing.types.PatchedEditFieldMappingRequest; 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 +79,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 +114,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 +134,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); } @@ -166,42 +151,48 @@ public MergeApiHttpResponse fieldMappingsCreate( * 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); + return fieldMappingsDestroy( + fieldMappingId, FieldMappingsDestroyRequest.builder().build()); } /** * 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) { + String fieldMappingId, FieldMappingsDestroyRequest request) { + return fieldMappingsDestroy(fieldMappingId, request, 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, FieldMappingsDestroyRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/field-mappings") .addPathSegment(fieldMappingId) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("DELETE", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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); } @@ -253,17 +244,14 @@ public MergeApiHttpResponse fieldMappingsPartialUp } try (Response response = client.newCall(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 +302,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 +342,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..25a0facd9 100644 --- a/src/main/java/com/merge/api/ticketing/RawIssuesClient.java +++ b/src/main/java/com/merge/api/ticketing/RawIssuesClient.java @@ -13,11 +13,11 @@ import com.merge.api.core.SyncPagingIterable; import com.merge.api.ticketing.types.Issue; import com.merge.api.ticketing.types.IssuesListRequest; +import com.merge.api.ticketing.types.IssuesRetrieveRequest; import com.merge.api.ticketing.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; @@ -137,27 +137,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedIssueList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -167,40 +164,45 @@ public MergeApiHttpResponse> list( * Get a specific issue. */ public MergeApiHttpResponse retrieve(String id) { - return retrieve(id, null); + return retrieve(id, IssuesRetrieveRequest.builder().build()); + } + + /** + * Get a specific issue. + */ + public MergeApiHttpResponse retrieve(String id, IssuesRetrieveRequest request) { + return retrieve(id, request, null); } /** * Get a specific issue. */ - public MergeApiHttpResponse retrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse retrieve( + String id, IssuesRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/issues") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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..215c7704e 100644 --- a/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java +++ b/src/main/java/com/merge/api/ticketing/RawLinkTokenClient.java @@ -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..bb87de6f2 100644 --- a/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawLinkedAccountsClient.java @@ -17,7 +17,6 @@ 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; @@ -128,10 +127,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + responseBodyString, PaginatedAccountDetailsAndActionsList.class); + String startingAfter = parsedResponse.getNext().orElse(null); LinkedAccountsListRequest nextRequest = LinkedAccountsListRequest.builder() .from(request) .cursor(startingAfter) @@ -140,17 +140,13 @@ public MergeApiHttpResponse> list( parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> list( + !startingAfter.isEmpty(), 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/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..d878afe38 100644 --- a/src/main/java/com/merge/api/ticketing/RawProjectsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawProjectsClient.java @@ -21,7 +21,6 @@ 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; @@ -116,27 +115,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedProjectList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ProjectsListRequest nextRequest = ProjectsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -188,16 +184,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,27 +262,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); ProjectsUsersListRequest nextRequest = ProjectsUsersListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> usersList( + new SyncPagingIterable(!startingAfter.isEmpty(), result, parsedResponse, () -> usersList( parentId, 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/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..d5e7e0597 100644 --- a/src/main/java/com/merge/api/ticketing/RawRolesClient.java +++ b/src/main/java/com/merge/api/ticketing/RawRolesClient.java @@ -18,7 +18,6 @@ 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; @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRoleList.class); + String startingAfter = parsedResponse.getNext().orElse(null); RolesListRequest nextRequest = RolesListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -184,16 +180,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..9e4c21826 100644 --- a/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java +++ b/src/main/java/com/merge/api/ticketing/RawSyncStatusClient.java @@ -17,7 +17,6 @@ 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; @@ -74,28 +73,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedSyncStatusList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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()), + new SyncPagingIterable(!startingAfter.isEmpty(), 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/ticketing/RawTagsClient.java b/src/main/java/com/merge/api/ticketing/RawTagsClient.java index 97e639a08..8993c404f 100644 --- a/src/main/java/com/merge/api/ticketing/RawTagsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTagsClient.java @@ -18,7 +18,6 @@ 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; @@ -112,27 +111,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTagList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TagsListRequest nextRequest = TagsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -183,16 +179,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..bf60a97c7 100644 --- a/src/main/java/com/merge/api/ticketing/RawTeamsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTeamsClient.java @@ -18,7 +18,6 @@ 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; @@ -113,27 +112,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTeamList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TeamsListRequest nextRequest = TeamsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -184,16 +180,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..9d259c21f 100644 --- a/src/main/java/com/merge/api/ticketing/RawTicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/RawTicketsClient.java @@ -22,6 +22,7 @@ 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.TicketsMetaPatchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; @@ -29,10 +30,7 @@ import com.merge.api.ticketing.types.Viewer; 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; import okhttp3.OkHttpClient; @@ -243,27 +241,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedTicketList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsListRequest nextRequest = TicketsListRequest.builder() .from(request) .cursor(startingAfter) .build(); List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( - new SyncPagingIterable(startingAfter.isPresent(), result, parsedResponse, () -> list( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -291,12 +286,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 +306,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 +383,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 +419,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 +439,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,10 +518,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedViewerList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsViewersListRequest nextRequest = TicketsViewersListRequest.builder() .from(request) .cursor(startingAfter) @@ -547,17 +530,13 @@ public MergeApiHttpResponse> viewersList( List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> viewersList( + !startingAfter.isEmpty(), result, parsedResponse, () -> viewersList( ticketId, 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); } @@ -567,40 +546,45 @@ public MergeApiHttpResponse> viewersList( * Returns metadata for Ticket PATCHs. */ public MergeApiHttpResponse metaPatchRetrieve(String id) { - return metaPatchRetrieve(id, null); + return metaPatchRetrieve(id, TicketsMetaPatchRetrieveRequest.builder().build()); } /** * Returns metadata for Ticket PATCHs. */ - public MergeApiHttpResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { + public MergeApiHttpResponse metaPatchRetrieve(String id, TicketsMetaPatchRetrieveRequest request) { + return metaPatchRetrieve(id, request, null); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MergeApiHttpResponse metaPatchRetrieve( + String id, TicketsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { HttpUrl httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("ticketing/v1/tickets/meta/patch") .addPathSegment(id) .build(); - Request okhttpRequest = new Request.Builder() + Request.Builder _requestBuilder = new Request.Builder() .url(httpUrl) .method("GET", null) .headers(Headers.of(clientOptions.headers(requestOptions))) - .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(), 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 +632,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,10 +720,11 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedRemoteFieldClassList.class); + String startingAfter = parsedResponse.getNext().orElse(null); TicketsRemoteFieldClassesListRequest nextRequest = TicketsRemoteFieldClassesListRequest.builder() .from(request) .cursor(startingAfter) @@ -750,17 +732,13 @@ public MergeApiHttpResponse> remoteFieldCla List result = parsedResponse.getResults().orElse(Collections.emptyList()); return new MergeApiHttpResponse<>( new SyncPagingIterable( - startingAfter.isPresent(), result, parsedResponse, () -> remoteFieldClassesList( + !startingAfter.isEmpty(), result, parsedResponse, () -> remoteFieldClassesList( 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/ticketing/RawUsersClient.java b/src/main/java/com/merge/api/ticketing/RawUsersClient.java index 1f3a380ac..8c58d5640 100644 --- a/src/main/java/com/merge/api/ticketing/RawUsersClient.java +++ b/src/main/java/com/merge/api/ticketing/RawUsersClient.java @@ -18,7 +18,6 @@ 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; @@ -125,27 +124,24 @@ 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); - Optional startingAfter = parsedResponse.getNext(); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, PaginatedUserList.class); + String startingAfter = parsedResponse.getNext().orElse(null); 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( + new SyncPagingIterable(!startingAfter.isEmpty(), 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); } @@ -200,16 +196,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..7a119694b 100644 --- a/src/main/java/com/merge/api/ticketing/TicketsClient.java +++ b/src/main/java/com/merge/api/ticketing/TicketsClient.java @@ -13,6 +13,7 @@ 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.TicketsMetaPatchRetrieveRequest; import com.merge.api.ticketing.types.TicketsMetaPostRetrieveRequest; import com.merge.api.ticketing.types.TicketsRemoteFieldClassesListRequest; import com.merge.api.ticketing.types.TicketsRetrieveRequest; @@ -139,8 +140,16 @@ public MetaResponse metaPatchRetrieve(String id) { /** * Returns metadata for Ticket PATCHs. */ - public MetaResponse metaPatchRetrieve(String id, RequestOptions requestOptions) { - return this.rawClient.metaPatchRetrieve(id, requestOptions).body(); + public MetaResponse metaPatchRetrieve(String id, TicketsMetaPatchRetrieveRequest request) { + return this.rawClient.metaPatchRetrieve(id, request).body(); + } + + /** + * Returns metadata for Ticket PATCHs. + */ + public MetaResponse metaPatchRetrieve( + String id, TicketsMetaPatchRetrieveRequest request, RequestOptions requestOptions) { + return this.rawClient.metaPatchRetrieve(id, request, requestOptions).body(); } /** diff --git a/src/main/java/com/merge/api/ticketing/types/Account.java b/src/main/java/com/merge/api/ticketing/types/Account.java index 5f674b203..9d115a26e 100644 --- a/src/main/java/com/merge/api/ticketing/types/Account.java +++ b/src/main/java/com/merge/api/ticketing/types/Account.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,16 +104,22 @@ public Optional getModifiedAt() { /** * @return The account's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The account's domain names. */ - @JsonProperty("domains") + @JsonIgnore public Optional>> getDomains() { + if (domains == null) { + return Optional.empty(); + } return domains; } @@ -119,13 +131,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("domains") + private Optional>> _getDomains() { + return domains; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -238,6 +286,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -280,6 +339,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

          The account's domain names.

          */ @@ -294,6 +364,17 @@ public Builder domains(List> domains) { return this; } + public Builder domains(Nullable>> domains) { + if (domains.isNull()) { + this.domains = null; + } else if (domains.isEmpty()) { + this.domains = Optional.empty(); + } else { + this.domains = Optional.of(domains.get()); + } + 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.

          */ @@ -319,6 +400,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -330,6 +422,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Account build() { return new Account( id, 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..f6e4b5af5 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountDetails.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetails.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -91,8 +94,11 @@ public Optional getIntegrationSlug() { return integrationSlug; } - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -124,8 +130,11 @@ public Optional getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -137,8 +146,29 @@ public Optional getAccountType() { /** * @return The time at which account completes the linking flow. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { return completedAt; } @@ -285,6 +315,17 @@ public Builder category(AccountDetailsCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + @JsonSetter(value = "end_user_origin_id", nulls = Nulls.SKIP) public Builder endUserOriginId(Optional endUserOriginId) { this.endUserOriginId = endUserOriginId; @@ -354,6 +395,17 @@ public Builder isDuplicate(Boolean isDuplicate) { return this; } + public Builder isDuplicate(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + return this; + } + @JsonSetter(value = "account_type", nulls = Nulls.SKIP) public Builder accountType(Optional accountType) { this.accountType = accountType; @@ -379,6 +431,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + public AccountDetails build() { return new AccountDetails( id, 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..b3be67931 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountDetailsAndActions.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -132,8 +135,11 @@ public String getWebhookListenerUrl() { /** * @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") + @JsonIgnore public Optional getIsDuplicate() { + if (isDuplicate == null) { + return Optional.empty(); + } return isDuplicate; } @@ -152,6 +158,12 @@ public OffsetDateTime getCompletedAt() { return completedAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_duplicate") + private Optional _getIsDuplicate() { + return isDuplicate; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -265,6 +277,8 @@ public interface _FinalStage { _FinalStage isDuplicate(Boolean isDuplicate); + _FinalStage isDuplicate(Nullable isDuplicate); + _FinalStage integration(Optional integration); _FinalStage integration(AccountDetailsAndActionsIntegration integration); @@ -391,6 +405,22 @@ public _FinalStage integration(Optional int 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(Nullable isDuplicate) { + if (isDuplicate.isNull()) { + this.isDuplicate = null; + } else if (isDuplicate.isEmpty()) { + this.isDuplicate = Optional.empty(); + } else { + this.isDuplicate = Optional.of(isDuplicate.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java b/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java index 787eabe89..92f102e5e 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountIntegration.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -81,8 +84,11 @@ public String getName() { /** * @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") + @JsonIgnore public Optional getAbbreviatedName() { + if (abbreviatedName == null) { + return Optional.empty(); + } return abbreviatedName; } @@ -97,16 +103,22 @@ public Optional> getCategories() { /** * @return Company logo in rectangular shape. */ - @JsonProperty("image") + @JsonIgnore public Optional getImage() { + if (image == null) { + return Optional.empty(); + } return image; } /** * @return Company logo in square shape. */ - @JsonProperty("square_image") + @JsonIgnore public Optional getSquareImage() { + if (squareImage == null) { + return Optional.empty(); + } return squareImage; } @@ -134,8 +146,11 @@ public Optional> getApiEndpointsToDocumentationUrls() { /** * @return Setup guide URL for third party webhook creation. Exposed in Merge Docs. */ - @JsonProperty("webhook_setup_guide_url") + @JsonIgnore public Optional getWebhookSetupGuideUrl() { + if (webhookSetupGuideUrl == null) { + return Optional.empty(); + } return webhookSetupGuideUrl; } @@ -147,6 +162,30 @@ public Optional> getCategoryBetaStatus() { return categoryBetaStatus; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("abbreviated_name") + private Optional _getAbbreviatedName() { + return abbreviatedName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image") + private Optional _getImage() { + return image; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("square_image") + private Optional _getSquareImage() { + return squareImage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("webhook_setup_guide_url") + private Optional _getWebhookSetupGuideUrl() { + return webhookSetupGuideUrl; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -214,6 +253,8 @@ public interface _FinalStage { _FinalStage abbreviatedName(String abbreviatedName); + _FinalStage abbreviatedName(Nullable abbreviatedName); + /** *

          Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris].

          */ @@ -228,6 +269,8 @@ public interface _FinalStage { _FinalStage image(String image); + _FinalStage image(Nullable image); + /** *

          Company logo in square shape.

          */ @@ -235,6 +278,8 @@ public interface _FinalStage { _FinalStage squareImage(String squareImage); + _FinalStage squareImage(Nullable squareImage); + /** *

          The color of this integration used for buttons and text throughout the app and landing pages. <b>Choose a darker, saturated color.</b>

          */ @@ -260,6 +305,8 @@ public interface _FinalStage { _FinalStage webhookSetupGuideUrl(String webhookSetupGuideUrl); + _FinalStage webhookSetupGuideUrl(Nullable webhookSetupGuideUrl); + /** *

          Category or categories this integration is in beta status for.

          */ @@ -342,6 +389,22 @@ public _FinalStage categoryBetaStatus(Optional> categoryBe 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(Nullable webhookSetupGuideUrl) { + if (webhookSetupGuideUrl.isNull()) { + this.webhookSetupGuideUrl = null; + } else if (webhookSetupGuideUrl.isEmpty()) { + this.webhookSetupGuideUrl = Optional.empty(); + } else { + this.webhookSetupGuideUrl = Optional.of(webhookSetupGuideUrl.get()); + } + 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. @@ -416,6 +479,22 @@ public _FinalStage color(Optional 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(Nullable squareImage) { + if (squareImage.isNull()) { + this.squareImage = null; + } else if (squareImage.isEmpty()) { + this.squareImage = Optional.empty(); + } else { + this.squareImage = Optional.of(squareImage.get()); + } + return this; + } + /** *

          Company logo in square shape.

          * @return Reference to {@code this} so that method calls can be chained together. @@ -436,6 +515,22 @@ public _FinalStage squareImage(Optional 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(Nullable image) { + if (image.isNull()) { + this.image = null; + } else if (image.isEmpty()) { + this.image = Optional.empty(); + } else { + this.image = Optional.of(image.get()); + } + return this; + } + /** *

          Company logo in rectangular shape.

          * @return Reference to {@code this} so that method calls can be chained together. @@ -476,6 +571,22 @@ public _FinalStage categories(Optional> 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(Nullable abbreviatedName) { + if (abbreviatedName.isNull()) { + this.abbreviatedName = null; + } else if (abbreviatedName.isEmpty()) { + this.abbreviatedName = Optional.empty(); + } else { + this.abbreviatedName = Optional.of(abbreviatedName.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ticketing/types/AccountTokenRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AccountTokenRetrieveRequest.java new file mode 100644 index 000000000..c98507f8d --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AccountTokenRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AccountTokenRetrieveRequest.Builder.class) +public final class AccountTokenRetrieveRequest { + private final Map additionalProperties; + + private AccountTokenRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AccountTokenRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AccountTokenRetrieveRequest other) { + return this; + } + + public AccountTokenRetrieveRequest build() { + return new AccountTokenRetrieveRequest(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..62f10643a 100644 --- a/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public AccountsListRequest build() { return new AccountsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveRequest.java new file mode 100644 index 000000000..3c53cbf6c --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AsyncPassthroughRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = AsyncPassthroughRetrieveRequest.Builder.class) +public final class AsyncPassthroughRetrieveRequest { + private final Map additionalProperties; + + private AsyncPassthroughRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AsyncPassthroughRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(AsyncPassthroughRetrieveRequest other) { + return this; + } + + public AsyncPassthroughRetrieveRequest build() { + return new AsyncPassthroughRetrieveRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Attachment.java b/src/main/java/com/merge/api/ticketing/types/Attachment.java index af88c8808..4b46d2c8a 100644 --- a/src/main/java/com/merge/api/ticketing/types/Attachment.java +++ b/src/main/java/com/merge/api/ticketing/types/Attachment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,48 +120,66 @@ public Optional getModifiedAt() { /** * @return The attachment's name. It is required to include the file extension in the attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The ticket associated with the attachment. */ - @JsonProperty("ticket") + @JsonIgnore public Optional getTicket() { + if (ticket == null) { + return Optional.empty(); + } return ticket; } /** * @return The attachment's url. It is required to include the file extension in the file's URL. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The attachment's file format. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } return contentType; } /** * @return The user who uploaded the attachment. */ - @JsonProperty("uploaded_by") + @JsonIgnore public Optional getUploadedBy() { + if (uploadedBy == null) { + return Optional.empty(); + } return uploadedBy; } /** * @return When the third party's attachment was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -167,13 +191,73 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket") + private Optional _getTicket() { + return ticket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("uploaded_by") + private Optional _getUploadedBy() { + return uploadedBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -306,6 +390,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          The datetime that this object was created by Merge.

          */ @@ -348,6 +443,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

          The ticket associated with the attachment.

          */ @@ -362,6 +468,17 @@ public Builder ticket(AttachmentTicket ticket) { return this; } + public Builder ticket(Nullable ticket) { + if (ticket.isNull()) { + this.ticket = null; + } else if (ticket.isEmpty()) { + this.ticket = Optional.empty(); + } else { + this.ticket = Optional.of(ticket.get()); + } + return this; + } + /** *

          The attachment's url. It is required to include the file extension in the file's URL.

          */ @@ -376,6 +493,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

          The attachment's file format.

          */ @@ -390,6 +518,17 @@ public Builder contentType(String contentType) { return this; } + public Builder contentType(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + return this; + } + /** *

          The user who uploaded the attachment.

          */ @@ -404,6 +543,17 @@ public Builder uploadedBy(String uploadedBy) { return this; } + public Builder uploadedBy(Nullable uploadedBy) { + if (uploadedBy.isNull()) { + this.uploadedBy = null; + } else if (uploadedBy.isEmpty()) { + this.uploadedBy = Optional.empty(); + } else { + this.uploadedBy = Optional.of(uploadedBy.get()); + } + return this; + } + /** *

          When the third party's attachment was created.

          */ @@ -418,6 +568,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

          */ @@ -443,6 +604,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -454,6 +626,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Attachment build() { return new Attachment( id, diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java index ed3c73e95..94e5d7c82 100644 --- a/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -59,50 +62,113 @@ private AttachmentRequest( /** * @return The attachment's name. It is required to include the file extension in the attachment's name. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The ticket associated with the attachment. */ - @JsonProperty("ticket") + @JsonIgnore public Optional getTicket() { + if (ticket == null) { + return Optional.empty(); + } return ticket; } /** * @return The attachment's url. It is required to include the file extension in the file's URL. */ - @JsonProperty("file_url") + @JsonIgnore public Optional getFileUrl() { + if (fileUrl == null) { + return Optional.empty(); + } return fileUrl; } /** * @return The attachment's file format. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } return contentType; } /** * @return The user who uploaded the attachment. */ - @JsonProperty("uploaded_by") + @JsonIgnore public Optional getUploadedBy() { + if (uploadedBy == null) { + return Optional.empty(); + } return uploadedBy; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket") + private Optional _getTicket() { + return ticket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_url") + private Optional _getFileUrl() { + return fileUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("uploaded_by") + private Optional _getUploadedBy() { + return uploadedBy; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -194,6 +260,17 @@ public Builder fileName(String fileName) { return this; } + public Builder fileName(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + return this; + } + /** *

          The ticket associated with the attachment.

          */ @@ -208,6 +285,17 @@ public Builder ticket(AttachmentRequestTicket ticket) { return this; } + public Builder ticket(Nullable ticket) { + if (ticket.isNull()) { + this.ticket = null; + } else if (ticket.isEmpty()) { + this.ticket = Optional.empty(); + } else { + this.ticket = Optional.of(ticket.get()); + } + return this; + } + /** *

          The attachment's url. It is required to include the file extension in the file's URL.

          */ @@ -222,6 +310,17 @@ public Builder fileUrl(String fileUrl) { return this; } + public Builder fileUrl(Nullable fileUrl) { + if (fileUrl.isNull()) { + this.fileUrl = null; + } else if (fileUrl.isEmpty()) { + this.fileUrl = Optional.empty(); + } else { + this.fileUrl = Optional.of(fileUrl.get()); + } + return this; + } + /** *

          The attachment's file format.

          */ @@ -236,6 +335,17 @@ public Builder contentType(String contentType) { return this; } + public Builder contentType(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + return this; + } + /** *

          The user who uploaded the attachment.

          */ @@ -250,6 +360,17 @@ public Builder uploadedBy(String uploadedBy) { return this; } + public Builder uploadedBy(Nullable uploadedBy) { + if (uploadedBy.isNull()) { + this.uploadedBy = null; + } else if (uploadedBy.isEmpty()) { + this.uploadedBy = Optional.empty(); + } else { + this.uploadedBy = Optional.of(uploadedBy.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -261,6 +382,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -272,6 +404,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public AttachmentRequest build() { return new AttachmentRequest( fileName, diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java index 7ae7453c2..6974d0db0 100644 --- a/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AttachmentsListRequest.Builder.class) public final class AttachmentsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -52,7 +55,7 @@ public final class AttachmentsListRequest { private final Map additionalProperties; private AttachmentsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -86,7 +89,7 @@ private AttachmentsListRequest( * @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; } @@ -165,16 +168,22 @@ public Optional getPageSize() { /** * @return If provided, will only return attachments created in the third party platform after this datetime. */ - @JsonProperty("remote_created_after") + @JsonIgnore public Optional getRemoteCreatedAfter() { + if (remoteCreatedAfter == null) { + return Optional.empty(); + } return remoteCreatedAfter; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -186,6 +195,18 @@ public Optional getTicketId() { return ticketId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_after") + private Optional _getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -242,7 +263,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 createdAfter = Optional.empty(); @@ -294,17 +315,17 @@ public Builder from(AttachmentsListRequest 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(AttachmentsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -449,6 +470,17 @@ public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { return this; } + public Builder remoteCreatedAfter(Nullable remoteCreatedAfter) { + if (remoteCreatedAfter.isNull()) { + this.remoteCreatedAfter = null; + } else if (remoteCreatedAfter.isEmpty()) { + this.remoteCreatedAfter = Optional.empty(); + } else { + this.remoteCreatedAfter = Optional.of(remoteCreatedAfter.get()); + } + return this; + } + /** *

          The API provider's ID for the given object.

          */ @@ -463,6 +495,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

          If provided, will only return comments for this ticket.

          */ diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequestExpandItem.java new file mode 100644 index 000000000..e3cc79bc1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsListRequestExpandItem { + public static final AttachmentsListRequestExpandItem TICKET = + new AttachmentsListRequestExpandItem(Value.TICKET, "ticket"); + + private final Value value; + + private final String string; + + AttachmentsListRequestExpandItem(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 AttachmentsListRequestExpandItem + && this.string.equals(((AttachmentsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TICKET: + return visitor.visitTicket(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsListRequestExpandItem valueOf(String value) { + switch (value) { + case "ticket": + return TICKET; + default: + return new AttachmentsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + TICKET, + + UNKNOWN + } + + public interface Visitor { + T visitTicket(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java index cfa266f51..83b51a470 100644 --- a/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = AttachmentsRetrieveRequest.Builder.class) public final class AttachmentsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class AttachmentsRetrieveRequest { private final Map additionalProperties; private AttachmentsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private AttachmentsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(AttachmentsRetrieveRequest 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(AttachmentsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..94913a708 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/AttachmentsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 AttachmentsRetrieveRequestExpandItem { + public static final AttachmentsRetrieveRequestExpandItem TICKET = + new AttachmentsRetrieveRequestExpandItem(Value.TICKET, "ticket"); + + private final Value value; + + private final String string; + + AttachmentsRetrieveRequestExpandItem(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 AttachmentsRetrieveRequestExpandItem + && this.string.equals(((AttachmentsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TICKET: + return visitor.visitTicket(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AttachmentsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "ticket": + return TICKET; + default: + return new AttachmentsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + TICKET, + + UNKNOWN + } + + public interface Visitor { + T visitTicket(); + + 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..2ee3bd870 100644 --- a/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java +++ b/src/main/java/com/merge/api/ticketing/types/AuditLogEvent.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -69,16 +72,22 @@ public Optional getId() { /** * @return The User's full name at the time of this Event occurring. */ - @JsonProperty("user_name") + @JsonIgnore public Optional getUserName() { + if (userName == null) { + return Optional.empty(); + } return userName; } /** * @return The User's email at the time of this Event occurring. */ - @JsonProperty("user_email") + @JsonIgnore public Optional getUserEmail() { + if (userEmail == null) { + return Optional.empty(); + } return userEmail; } @@ -166,6 +175,18 @@ public Optional getCreatedAt() { return createdAt; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_name") + private Optional _getUserName() { + return userName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user_email") + private Optional _getUserEmail() { + return userEmail; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -301,6 +322,8 @@ public interface _FinalStage { _FinalStage userName(String userName); + _FinalStage userName(Nullable userName); + /** *

          The User's email at the time of this Event occurring.

          */ @@ -308,6 +331,8 @@ public interface _FinalStage { _FinalStage userEmail(String userEmail); + _FinalStage userEmail(Nullable userEmail); + _FinalStage createdAt(Optional createdAt); _FinalStage createdAt(OffsetDateTime createdAt); @@ -507,6 +532,22 @@ public _FinalStage createdAt(Optional 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(Nullable userEmail) { + if (userEmail.isNull()) { + this.userEmail = null; + } else if (userEmail.isEmpty()) { + this.userEmail = Optional.empty(); + } else { + this.userEmail = Optional.of(userEmail.get()); + } + 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. @@ -527,6 +568,22 @@ public _FinalStage userEmail(Optional 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(Nullable userName) { + if (userName.isNull()) { + this.userName = null; + } else if (userName.isEmpty()) { + this.userName = Optional.empty(); + } else { + this.userName = Optional.of(userName.get()); + } + 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. 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..ee46bf27c 100644 --- a/src/main/java/com/merge/api/ticketing/types/Collection.java +++ b/src/main/java/com/merge/api/ticketing/types/Collection.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -98,8 +101,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -122,16 +128,22 @@ public Optional getModifiedAt() { /** * @return The collection's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The collection's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -144,8 +156,11 @@ public Optional getDescription() { *
        • PARENT_COLLECTION - PARENT_COLLECTION
        • *
        */ - @JsonProperty("access_level") + @JsonIgnore public Optional getAccessLevel() { + if (accessLevel == null) { + return Optional.empty(); + } return accessLevel; } @@ -164,32 +179,44 @@ public Optional getCollectionType() { /** * @return The parent collection for this collection. */ - @JsonProperty("parent_collection") + @JsonIgnore public Optional getParentCollection() { + if (parentCollection == null) { + return Optional.empty(); + } return parentCollection; } /** * @return The 3rd party url of the Collection. */ - @JsonProperty("collection_url") + @JsonIgnore public Optional getCollectionUrl() { + if (collectionUrl == null) { + return Optional.empty(); + } return collectionUrl; } /** * @return When the third party's collection was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's collection was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } @@ -201,13 +228,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("access_level") + private Optional _getAccessLevel() { + return accessLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_collection") + private Optional _getParentCollection() { + return parentCollection; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("collection_url") + private Optional _getCollectionUrl() { + return collectionUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -350,6 +443,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -392,6 +496,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The collection's description.

        */ @@ -406,6 +521,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The level of access a User has to the Collection and its sub-objects.

        *
          @@ -426,6 +552,17 @@ public Builder accessLevel(CollectionAccessLevel accessLevel) { return this; } + public Builder accessLevel(Nullable accessLevel) { + if (accessLevel.isNull()) { + this.accessLevel = null; + } else if (accessLevel.isEmpty()) { + this.accessLevel = Optional.empty(); + } else { + this.accessLevel = Optional.of(accessLevel.get()); + } + return this; + } + /** *

          The collection's type.

          *
            @@ -458,6 +595,17 @@ public Builder parentCollection(CollectionParentCollection parentCollection) { return this; } + public Builder parentCollection(Nullable parentCollection) { + if (parentCollection.isNull()) { + this.parentCollection = null; + } else if (parentCollection.isEmpty()) { + this.parentCollection = Optional.empty(); + } else { + this.parentCollection = Optional.of(parentCollection.get()); + } + return this; + } + /** *

            The 3rd party url of the Collection.

            */ @@ -472,6 +620,17 @@ public Builder collectionUrl(String collectionUrl) { return this; } + public Builder collectionUrl(Nullable collectionUrl) { + if (collectionUrl.isNull()) { + this.collectionUrl = null; + } else if (collectionUrl.isEmpty()) { + this.collectionUrl = Optional.empty(); + } else { + this.collectionUrl = Optional.of(collectionUrl.get()); + } + return this; + } + /** *

            When the third party's collection was created.

            */ @@ -486,6 +645,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

            When the third party's collection was updated.

            */ @@ -500,6 +670,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + 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.

            */ @@ -525,6 +706,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -536,6 +728,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Collection build() { return new Collection( id, 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..ffd226792 100644 --- a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,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; @@ -49,16 +52,16 @@ public final class CollectionsListRequest { private final Optional parentCollectionId; - private final Optional remoteFields; + private final Optional remoteFields; private final Optional remoteId; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private CollectionsListRequest( - Optional> expand, + Optional> expand, Optional collectionType, Optional createdAfter, Optional createdBefore, @@ -71,9 +74,9 @@ private CollectionsListRequest( Optional name, Optional pageSize, Optional parentCollectionId, - Optional remoteFields, + Optional remoteFields, Optional remoteId, - Optional showEnumOrigins, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.collectionType = collectionType; @@ -98,15 +101,18 @@ 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; } /** * @return If provided, will only return collections of the given type. */ - @JsonProperty("collection_type") + @JsonIgnore public Optional getCollectionType() { + if (collectionType == null) { + return Optional.empty(); + } return collectionType; } @@ -177,8 +183,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return collections with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -202,15 +211,18 @@ public Optional getParentCollectionId() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -218,10 +230,28 @@ public Optional getRemoteId() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("collection_type") + private Optional _getCollectionType() { + return collectionType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -284,7 +314,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(); @@ -310,11 +340,11 @@ public static final class Builder { private Optional parentCollectionId = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); private Optional remoteId = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -345,17 +375,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; } @@ -374,6 +404,17 @@ public Builder collectionType(CollectionsListRequestCollectionType collectionTyp return this; } + public Builder collectionType(Nullable collectionType) { + if (collectionType.isNull()) { + this.collectionType = null; + } else if (collectionType.isEmpty()) { + this.collectionType = Optional.empty(); + } else { + this.collectionType = Optional.of(collectionType.get()); + } + return this; + } + /** *

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

            */ @@ -500,6 +541,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

            Number of results to return per page.

            */ @@ -532,12 +584,12 @@ public Builder parentCollectionId(String parentCollectionId) { *

            Deprecated. Use show_enum_origins.

            */ @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) - public Builder remoteFields(Optional remoteFields) { + public Builder remoteFields(Optional remoteFields) { this.remoteFields = remoteFields; return this; } - public Builder remoteFields(String remoteFields) { + public Builder remoteFields(CollectionsListRequestRemoteFields remoteFields) { this.remoteFields = Optional.ofNullable(remoteFields); return this; } @@ -556,16 +608,27 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + 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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(CollectionsListRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); return this; } 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..a7888b7c1 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 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 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 "parent_collection": + return PARENT_COLLECTION; + default: + return new CollectionsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_COLLECTION, + + UNKNOWN + } + + public interface Visitor { + T visitParentCollection(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestRemoteFields.java b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestRemoteFields.java new file mode 100644 index 000000000..1138642bf --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 CollectionsListRequestRemoteFields { + public static final CollectionsListRequestRemoteFields COLLECTION_TYPE = + new CollectionsListRequestRemoteFields(Value.COLLECTION_TYPE, "collection_type"); + + private final Value value; + + private final String string; + + CollectionsListRequestRemoteFields(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 CollectionsListRequestRemoteFields + && this.string.equals(((CollectionsListRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COLLECTION_TYPE: + return visitor.visitCollectionType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsListRequestRemoteFields valueOf(String value) { + switch (value) { + case "collection_type": + return COLLECTION_TYPE; + default: + return new CollectionsListRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + COLLECTION_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitCollectionType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestShowEnumOrigins.java new file mode 100644 index 000000000..8710f739a --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsListRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 CollectionsListRequestShowEnumOrigins { + public static final CollectionsListRequestShowEnumOrigins COLLECTION_TYPE = + new CollectionsListRequestShowEnumOrigins(Value.COLLECTION_TYPE, "collection_type"); + + private final Value value; + + private final String string; + + CollectionsListRequestShowEnumOrigins(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 CollectionsListRequestShowEnumOrigins + && this.string.equals(((CollectionsListRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COLLECTION_TYPE: + return visitor.visitCollectionType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsListRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "collection_type": + return COLLECTION_TYPE; + default: + return new CollectionsListRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + COLLECTION_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitCollectionType(); + + 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..345672eb1 100644 --- a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequest.java @@ -22,24 +22,24 @@ @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; private final Optional includeShellData; - private final Optional remoteFields; + private final Optional remoteFields; - private final Optional showEnumOrigins; + private final Optional showEnumOrigins; private final Map additionalProperties; private CollectionsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, - Optional remoteFields, - Optional showEnumOrigins, + Optional remoteFields, + Optional showEnumOrigins, Map additionalProperties) { this.expand = expand; this.includeRemoteData = includeRemoteData; @@ -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; } @@ -77,7 +77,7 @@ public Optional getIncludeShellData() { * @return Deprecated. Use show_enum_origins. */ @JsonProperty("remote_fields") - public Optional getRemoteFields() { + public Optional getRemoteFields() { return remoteFields; } @@ -85,7 +85,7 @@ public Optional getRemoteFields() { * @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() { + public Optional getShowEnumOrigins() { return showEnumOrigins; } @@ -125,15 +125,15 @@ 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(); private Optional includeShellData = Optional.empty(); - private Optional remoteFields = Optional.empty(); + private Optional remoteFields = Optional.empty(); - private Optional showEnumOrigins = Optional.empty(); + private Optional showEnumOrigins = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -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; } @@ -200,12 +200,12 @@ public Builder includeShellData(Boolean includeShellData) { *

            Deprecated. Use show_enum_origins.

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

            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) { + public Builder showEnumOrigins(Optional showEnumOrigins) { this.showEnumOrigins = showEnumOrigins; return this; } - public Builder showEnumOrigins(String showEnumOrigins) { + public Builder showEnumOrigins(CollectionsRetrieveRequestShowEnumOrigins showEnumOrigins) { this.showEnumOrigins = Optional.ofNullable(showEnumOrigins); 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..72f20fdec --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 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 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 "parent_collection": + return PARENT_COLLECTION; + default: + return new CollectionsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + PARENT_COLLECTION, + + UNKNOWN + } + + public interface Visitor { + T visitParentCollection(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestRemoteFields.java b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestRemoteFields.java new file mode 100644 index 000000000..89ef441af --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestRemoteFields.java @@ -0,0 +1,75 @@ +/** + * 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 CollectionsRetrieveRequestRemoteFields { + public static final CollectionsRetrieveRequestRemoteFields COLLECTION_TYPE = + new CollectionsRetrieveRequestRemoteFields(Value.COLLECTION_TYPE, "collection_type"); + + private final Value value; + + private final String string; + + CollectionsRetrieveRequestRemoteFields(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 CollectionsRetrieveRequestRemoteFields + && this.string.equals(((CollectionsRetrieveRequestRemoteFields) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COLLECTION_TYPE: + return visitor.visitCollectionType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsRetrieveRequestRemoteFields valueOf(String value) { + switch (value) { + case "collection_type": + return COLLECTION_TYPE; + default: + return new CollectionsRetrieveRequestRemoteFields(Value.UNKNOWN, value); + } + } + + public enum Value { + COLLECTION_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitCollectionType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestShowEnumOrigins.java b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestShowEnumOrigins.java new file mode 100644 index 000000000..5a0a27415 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/CollectionsRetrieveRequestShowEnumOrigins.java @@ -0,0 +1,75 @@ +/** + * 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 CollectionsRetrieveRequestShowEnumOrigins { + public static final CollectionsRetrieveRequestShowEnumOrigins COLLECTION_TYPE = + new CollectionsRetrieveRequestShowEnumOrigins(Value.COLLECTION_TYPE, "collection_type"); + + private final Value value; + + private final String string; + + CollectionsRetrieveRequestShowEnumOrigins(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 CollectionsRetrieveRequestShowEnumOrigins + && this.string.equals(((CollectionsRetrieveRequestShowEnumOrigins) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COLLECTION_TYPE: + return visitor.visitCollectionType(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CollectionsRetrieveRequestShowEnumOrigins valueOf(String value) { + switch (value) { + case "collection_type": + return COLLECTION_TYPE; + default: + return new CollectionsRetrieveRequestShowEnumOrigins(Value.UNKNOWN, value); + } + } + + public enum Value { + COLLECTION_TYPE, + + UNKNOWN + } + + public interface Visitor { + T visitCollectionType(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Comment.java b/src/main/java/com/merge/api/ticketing/types/Comment.java index 732ab94f9..f7220589b 100644 --- a/src/main/java/com/merge/api/ticketing/types/Comment.java +++ b/src/main/java/com/merge/api/ticketing/types/Comment.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -94,8 +97,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -118,56 +124,77 @@ public Optional getModifiedAt() { /** * @return 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. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } /** * @return 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. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The comment's text body. */ - @JsonProperty("body") + @JsonIgnore public Optional getBody() { + if (body == null) { + return Optional.empty(); + } return body; } /** * @return The comment's text body formatted as html. */ - @JsonProperty("html_body") + @JsonIgnore public Optional getHtmlBody() { + if (htmlBody == null) { + return Optional.empty(); + } return htmlBody; } /** * @return The ticket associated with the comment. */ - @JsonProperty("ticket") + @JsonIgnore public Optional getTicket() { + if (ticket == null) { + return Optional.empty(); + } return ticket; } /** * @return Whether or not the comment is internal. */ - @JsonProperty("is_private") + @JsonIgnore public Optional getIsPrivate() { + if (isPrivate == null) { + return Optional.empty(); + } return isPrivate; } /** * @return When the third party's comment was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } @@ -179,13 +206,79 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private Optional _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("html_body") + private Optional _getHtmlBody() { + return htmlBody; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket") + private Optional _getTicket() { + return ticket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_private") + private Optional _getIsPrivate() { + return isPrivate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -323,6 +416,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -365,6 +469,17 @@ public Builder user(CommentUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

            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.

            */ @@ -379,6 +494,17 @@ public Builder contact(CommentContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

            The comment's text body.

            */ @@ -393,6 +519,17 @@ public Builder body(String body) { return this; } + public Builder body(Nullable body) { + if (body.isNull()) { + this.body = null; + } else if (body.isEmpty()) { + this.body = Optional.empty(); + } else { + this.body = Optional.of(body.get()); + } + return this; + } + /** *

            The comment's text body formatted as html.

            */ @@ -407,6 +544,17 @@ public Builder htmlBody(String htmlBody) { return this; } + public Builder htmlBody(Nullable htmlBody) { + if (htmlBody.isNull()) { + this.htmlBody = null; + } else if (htmlBody.isEmpty()) { + this.htmlBody = Optional.empty(); + } else { + this.htmlBody = Optional.of(htmlBody.get()); + } + return this; + } + /** *

            The ticket associated with the comment.

            */ @@ -421,6 +569,17 @@ public Builder ticket(CommentTicket ticket) { return this; } + public Builder ticket(Nullable ticket) { + if (ticket.isNull()) { + this.ticket = null; + } else if (ticket.isEmpty()) { + this.ticket = Optional.empty(); + } else { + this.ticket = Optional.of(ticket.get()); + } + return this; + } + /** *

            Whether or not the comment is internal.

            */ @@ -435,6 +594,17 @@ public Builder isPrivate(Boolean isPrivate) { return this; } + public Builder isPrivate(Nullable isPrivate) { + if (isPrivate.isNull()) { + this.isPrivate = null; + } else if (isPrivate.isEmpty()) { + this.isPrivate = Optional.empty(); + } else { + this.isPrivate = Optional.of(isPrivate.get()); + } + return this; + } + /** *

            When the third party's comment was created.

            */ @@ -449,6 +619,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + 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.

            */ @@ -474,6 +655,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -485,6 +677,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Comment build() { return new Comment( id, diff --git a/src/main/java/com/merge/api/ticketing/types/CommentRequest.java b/src/main/java/com/merge/api/ticketing/types/CommentRequest.java index f3b12d0ed..869e3ce33 100644 --- a/src/main/java/com/merge/api/ticketing/types/CommentRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -63,58 +66,130 @@ private CommentRequest( /** * @return 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. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } return user; } /** * @return 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. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The comment's text body. */ - @JsonProperty("body") + @JsonIgnore public Optional getBody() { + if (body == null) { + return Optional.empty(); + } return body; } /** * @return The comment's text body formatted as html. */ - @JsonProperty("html_body") + @JsonIgnore public Optional getHtmlBody() { + if (htmlBody == null) { + return Optional.empty(); + } return htmlBody; } /** * @return The ticket associated with the comment. */ - @JsonProperty("ticket") + @JsonIgnore public Optional getTicket() { + if (ticket == null) { + return Optional.empty(); + } return ticket; } /** * @return Whether or not the comment is internal. */ - @JsonProperty("is_private") + @JsonIgnore public Optional getIsPrivate() { + if (isPrivate == null) { + return Optional.empty(); + } return isPrivate; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("body") + private Optional _getBody() { + return body; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("html_body") + private Optional _getHtmlBody() { + return htmlBody; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket") + private Optional _getTicket() { + return ticket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_private") + private Optional _getIsPrivate() { + return isPrivate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -211,6 +286,17 @@ public Builder user(CommentRequestUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + /** *

            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.

            */ @@ -225,6 +311,17 @@ public Builder contact(CommentRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

            The comment's text body.

            */ @@ -239,6 +336,17 @@ public Builder body(String body) { return this; } + public Builder body(Nullable body) { + if (body.isNull()) { + this.body = null; + } else if (body.isEmpty()) { + this.body = Optional.empty(); + } else { + this.body = Optional.of(body.get()); + } + return this; + } + /** *

            The comment's text body formatted as html.

            */ @@ -253,6 +361,17 @@ public Builder htmlBody(String htmlBody) { return this; } + public Builder htmlBody(Nullable htmlBody) { + if (htmlBody.isNull()) { + this.htmlBody = null; + } else if (htmlBody.isEmpty()) { + this.htmlBody = Optional.empty(); + } else { + this.htmlBody = Optional.of(htmlBody.get()); + } + return this; + } + /** *

            The ticket associated with the comment.

            */ @@ -267,6 +386,17 @@ public Builder ticket(CommentRequestTicket ticket) { return this; } + public Builder ticket(Nullable ticket) { + if (ticket.isNull()) { + this.ticket = null; + } else if (ticket.isEmpty()) { + this.ticket = Optional.empty(); + } else { + this.ticket = Optional.of(ticket.get()); + } + return this; + } + /** *

            Whether or not the comment is internal.

            */ @@ -281,6 +411,17 @@ public Builder isPrivate(Boolean isPrivate) { return this; } + public Builder isPrivate(Nullable isPrivate) { + if (isPrivate.isNull()) { + this.isPrivate = null; + } else if (isPrivate.isEmpty()) { + this.isPrivate = Optional.empty(); + } else { + this.isPrivate = Optional.of(isPrivate.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -292,6 +433,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -303,6 +455,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public CommentRequest build() { return new CommentRequest( user, 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..7e14984ef 100644 --- a/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/CommentsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -165,16 +168,22 @@ public Optional getPageSize() { /** * @return If provided, will only return Comments created in the third party platform after this datetime. */ - @JsonProperty("remote_created_after") + @JsonIgnore public Optional getRemoteCreatedAfter() { + if (remoteCreatedAfter == null) { + return Optional.empty(); + } return remoteCreatedAfter; } /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -186,6 +195,18 @@ public Optional getTicketId() { return ticketId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_after") + private Optional _getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -449,6 +470,17 @@ public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { return this; } + public Builder remoteCreatedAfter(Nullable remoteCreatedAfter) { + if (remoteCreatedAfter.isNull()) { + this.remoteCreatedAfter = null; + } else if (remoteCreatedAfter.isEmpty()) { + this.remoteCreatedAfter = Optional.empty(); + } else { + this.remoteCreatedAfter = Optional.of(remoteCreatedAfter.get()); + } + return this; + } + /** *

            The API provider's ID for the given object.

            */ @@ -463,6 +495,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            If provided, will only return comments for this ticket.

            */ diff --git a/src/main/java/com/merge/api/ticketing/types/Contact.java b/src/main/java/com/merge/api/ticketing/types/Contact.java index 7ea13444b..6ac2f22ce 100644 --- a/src/main/java/com/merge/api/ticketing/types/Contact.java +++ b/src/main/java/com/merge/api/ticketing/types/Contact.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -86,8 +89,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -110,40 +116,55 @@ public Optional getModifiedAt() { /** * @return The contact's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The contact's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The contact's phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return The contact's details. */ - @JsonProperty("details") + @JsonIgnore public Optional getDetails() { + if (details == null) { + return Optional.empty(); + } return details; } /** * @return The contact's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } @@ -155,13 +176,67 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("details") + private Optional _getDetails() { + return details; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -289,6 +364,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -331,6 +417,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

            The contact's email address.

            */ @@ -345,6 +442,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

            The contact's phone number.

            */ @@ -359,6 +467,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

            The contact's details.

            */ @@ -373,6 +492,17 @@ public Builder details(String details) { return this; } + public Builder details(Nullable details) { + if (details.isNull()) { + this.details = null; + } else if (details.isEmpty()) { + this.details = Optional.empty(); + } else { + this.details = Optional.of(details.get()); + } + return this; + } + /** *

            The contact's account.

            */ @@ -387,6 +517,17 @@ public Builder account(ContactAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + 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.

            */ @@ -412,6 +553,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -423,6 +575,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Contact build() { return new Contact( id, diff --git a/src/main/java/com/merge/api/ticketing/types/ContactRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactRequest.java index e55116cc7..3194c1237 100644 --- a/src/main/java/com/merge/api/ticketing/types/ContactRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ContactRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -59,50 +62,113 @@ private ContactRequest( /** * @return The contact's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The contact's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return The contact's phone number. */ - @JsonProperty("phone_number") + @JsonIgnore public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } return phoneNumber; } /** * @return The contact's details. */ - @JsonProperty("details") + @JsonIgnore public Optional getDetails() { + if (details == null) { + return Optional.empty(); + } return details; } /** * @return The contact's account. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } + return linkedAccountParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("details") + private Optional _getDetails() { + return details; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { return linkedAccountParams; } @@ -194,6 +260,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

            The contact's email address.

            */ @@ -208,6 +285,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

            The contact's phone number.

            */ @@ -222,6 +310,17 @@ public Builder phoneNumber(String phoneNumber) { return this; } + public Builder phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + /** *

            The contact's details.

            */ @@ -236,6 +335,17 @@ public Builder details(String details) { return this; } + public Builder details(Nullable details) { + if (details.isNull()) { + this.details = null; + } else if (details.isEmpty()) { + this.details = Optional.empty(); + } else { + this.details = Optional.of(details.get()); + } + return this; + } + /** *

            The contact's account.

            */ @@ -250,6 +360,17 @@ public Builder account(ContactRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -261,6 +382,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -272,6 +404,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + public ContactRequest build() { return new ContactRequest( name, 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..651b720c6 100644 --- a/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ContactsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -23,7 +26,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContactsListRequest.Builder.class) public final class ContactsListRequest { - private final Optional> expand; + private final Optional> expand; private final Optional createdAfter; @@ -50,7 +53,7 @@ public final class ContactsListRequest { private final Map additionalProperties; private ContactsListRequest( - Optional> expand, + Optional> expand, Optional createdAfter, Optional createdBefore, Optional cursor, @@ -82,7 +85,7 @@ private ContactsListRequest( * @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; } @@ -113,8 +116,11 @@ public Optional getCursor() { /** * @return If provided, will only return Contacts that match this email. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } @@ -169,8 +175,23 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -228,7 +249,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 createdAfter = Optional.empty(); @@ -277,17 +298,17 @@ public Builder from(ContactsListRequest 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(ContactsListRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } @@ -348,6 +369,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + 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.

            */ @@ -446,6 +478,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public ContactsListRequest build() { return new ContactsListRequest( expand, diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsListRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/ContactsListRequestExpandItem.java new file mode 100644 index 000000000..2795ae0ca --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactsListRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsListRequestExpandItem { + public static final ContactsListRequestExpandItem ACCOUNT = + new ContactsListRequestExpandItem(Value.ACCOUNT, "account"); + + private final Value value; + + private final String string; + + ContactsListRequestExpandItem(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 ContactsListRequestExpandItem + && this.string.equals(((ContactsListRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT: + return visitor.visitAccount(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsListRequestExpandItem valueOf(String value) { + switch (value) { + case "account": + return ACCOUNT; + default: + return new ContactsListRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT, + + UNKNOWN + } + + public interface Visitor { + T visitAccount(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java index 9de28f019..d071981bf 100644 --- a/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequest.java @@ -22,7 +22,7 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ContactsRetrieveRequest.Builder.class) public final class ContactsRetrieveRequest { - private final Optional> expand; + private final Optional> expand; private final Optional includeRemoteData; @@ -31,7 +31,7 @@ public final class ContactsRetrieveRequest { private final Map additionalProperties; private ContactsRetrieveRequest( - Optional> expand, + Optional> expand, Optional includeRemoteData, Optional includeShellData, Map additionalProperties) { @@ -45,7 +45,7 @@ private ContactsRetrieveRequest( * @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; } @@ -98,7 +98,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(); @@ -120,17 +120,17 @@ public Builder from(ContactsRetrieveRequest 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(ContactsRetrieveRequestExpandItem expand) { this.expand = Optional.of(Collections.singletonList(expand)); return this; } diff --git a/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequestExpandItem.java b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequestExpandItem.java new file mode 100644 index 000000000..fe71c0510 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/ContactsRetrieveRequestExpandItem.java @@ -0,0 +1,75 @@ +/** + * 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 ContactsRetrieveRequestExpandItem { + public static final ContactsRetrieveRequestExpandItem ACCOUNT = + new ContactsRetrieveRequestExpandItem(Value.ACCOUNT, "account"); + + private final Value value; + + private final String string; + + ContactsRetrieveRequestExpandItem(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 ContactsRetrieveRequestExpandItem + && this.string.equals(((ContactsRetrieveRequestExpandItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCOUNT: + return visitor.visitAccount(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ContactsRetrieveRequestExpandItem valueOf(String value) { + switch (value) { + case "account": + return ACCOUNT; + default: + return new ContactsRetrieveRequestExpandItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCOUNT, + + UNKNOWN + } + + public interface Visitor { + T visitAccount(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java b/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java index 8bede8661..2a44323c9 100644 --- a/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/DataPassthroughRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -78,37 +81,52 @@ public String getPath() { /** * @return An optional override of the third party's base url for the request. */ - @JsonProperty("base_url_override") + @JsonIgnore public Optional getBaseUrlOverride() { + if (baseUrlOverride == null) { + return Optional.empty(); + } return baseUrlOverride; } /** * @return The data with the request. You must include a request_format parameter matching the data's format */ - @JsonProperty("data") + @JsonIgnore public Optional getData() { + if (data == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getMultipartFormData() { + if (multipartFormData == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getHeaders() { + if (headers == null) { + return Optional.empty(); + } return headers; } - @JsonProperty("request_format") + @JsonIgnore public Optional getRequestFormat() { + if (requestFormat == null) { + return Optional.empty(); + } return requestFormat; } @@ -120,6 +138,36 @@ public Optional getNormalizeResponse() { return normalizeResponse; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("base_url_override") + private Optional _getBaseUrlOverride() { + return baseUrlOverride; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("data") + private Optional _getData() { + return data; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_form_data") + private Optional> _getMultipartFormData() { + return multipartFormData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headers") + private Optional> _getHeaders() { + return headers; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("request_format") + private Optional _getRequestFormat() { + return requestFormat; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -187,6 +235,8 @@ public interface _FinalStage { _FinalStage baseUrlOverride(String baseUrlOverride); + _FinalStage baseUrlOverride(Nullable baseUrlOverride); + /** *

            The data with the request. You must include a request_format parameter matching the data's format

            */ @@ -194,6 +244,8 @@ public interface _FinalStage { _FinalStage data(String data); + _FinalStage data(Nullable data); + /** *

            Pass an array of MultipartFormField objects in here instead of using the data param if request_format is set to MULTIPART.

            */ @@ -201,6 +253,8 @@ public interface _FinalStage { _FinalStage multipartFormData(List multipartFormData); + _FinalStage multipartFormData(Nullable> 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.

            */ @@ -208,10 +262,14 @@ public interface _FinalStage { _FinalStage headers(Map headers); + _FinalStage headers(Nullable> headers); + _FinalStage requestFormat(Optional requestFormat); _FinalStage requestFormat(RequestFormatEnum requestFormat); + _FinalStage requestFormat(Nullable 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.

            */ @@ -295,6 +353,18 @@ public _FinalStage normalizeResponse(Optional normalizeResponse) { return this; } + @java.lang.Override + public _FinalStage requestFormat(Nullable requestFormat) { + if (requestFormat.isNull()) { + this.requestFormat = null; + } else if (requestFormat.isEmpty()) { + this.requestFormat = Optional.empty(); + } else { + this.requestFormat = Optional.of(requestFormat.get()); + } + return this; + } + @java.lang.Override public _FinalStage requestFormat(RequestFormatEnum requestFormat) { this.requestFormat = Optional.ofNullable(requestFormat); @@ -308,6 +378,22 @@ public _FinalStage requestFormat(Optional 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(Nullable> headers) { + if (headers.isNull()) { + this.headers = null; + } else if (headers.isEmpty()) { + this.headers = Optional.empty(); + } else { + this.headers = Optional.of(headers.get()); + } + 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. @@ -328,6 +414,22 @@ public _FinalStage headers(Optional> 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(Nullable> multipartFormData) { + if (multipartFormData.isNull()) { + this.multipartFormData = null; + } else if (multipartFormData.isEmpty()) { + this.multipartFormData = Optional.empty(); + } else { + this.multipartFormData = Optional.of(multipartFormData.get()); + } + 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. @@ -348,6 +450,22 @@ public _FinalStage multipartFormData(Optional> m 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(Nullable data) { + if (data.isNull()) { + this.data = null; + } else if (data.isEmpty()) { + this.data = Optional.empty(); + } else { + this.data = Optional.of(data.get()); + } + 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. @@ -368,6 +486,22 @@ public _FinalStage data(Optional 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(Nullable baseUrlOverride) { + if (baseUrlOverride.isNull()) { + this.baseUrlOverride = null; + } else if (baseUrlOverride.isEmpty()) { + this.baseUrlOverride = Optional.empty(); + } else { + this.baseUrlOverride = Optional.of(baseUrlOverride.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java b/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java index 991af7e23..01e82ff77 100644 --- a/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/EncodingEnum.java @@ -9,9 +9,9 @@ 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 BASE64 = new EncodingEnum(Value.BASE64, "BASE64"); - public static final EncodingEnum BASE_64 = new EncodingEnum(Value.BASE_64, "BASE64"); + public static final EncodingEnum GZIP_BASE64 = new EncodingEnum(Value.GZIP_BASE64, "GZIP_BASE64"); private final Value value; @@ -46,10 +46,10 @@ public T visit(Visitor visitor) { switch (value) { case RAW: return visitor.visitRaw(); - case GZIP_BASE_64: - return visitor.visitGzipBase64(); - case BASE_64: + case BASE64: return visitor.visitBase64(); + case GZIP_BASE64: + return visitor.visitGzipBase64(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -61,10 +61,10 @@ public static EncodingEnum valueOf(String value) { switch (value) { case "RAW": return RAW; - case "GZIP_BASE64": - return GZIP_BASE_64; case "BASE64": - return BASE_64; + return BASE64; + case "GZIP_BASE64": + return GZIP_BASE64; default: return new EncodingEnum(Value.UNKNOWN, value); } @@ -73,9 +73,9 @@ public static EncodingEnum valueOf(String value) { public enum Value { RAW, - BASE_64, + BASE64, - GZIP_BASE_64, + GZIP_BASE64, UNKNOWN } diff --git a/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java b/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java index 0e902558f..bdbfa77b4 100644 --- a/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/EndUserDetailsRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.ArrayList; import java.util.HashMap; @@ -120,8 +123,11 @@ public List getCategories() { /** * @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") + @JsonIgnore public Optional getIntegration() { + if (integration == null) { + return Optional.empty(); + } return integration; } @@ -136,33 +142,45 @@ public Optional getLinkExpiryMins() { /** * @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") + @JsonIgnore public Optional getShouldCreateMagicLinkUrl() { + if (shouldCreateMagicLinkUrl == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional getHideAdminMagicLink() { + if (hideAdminMagicLink == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional> getCommonModels() { + if (commonModels == null) { + return Optional.empty(); + } 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") + @JsonIgnore public Optional>>> getCategoryCommonModelScopes() { + if (categoryCommonModelScopes == null) { + return Optional.empty(); + } return categoryCommonModelScopes; } @@ -173,24 +191,82 @@ public Optional> getCommonModels() { *
          • de - de
          • *
          */ - @JsonProperty("language") + @JsonIgnore public Optional getLanguage() { + if (language == null) { + return Optional.empty(); + } return language; } /** * @return The boolean that indicates whether initial, periodic, and force syncs will be disabled. */ - @JsonProperty("are_syncs_disabled") + @JsonIgnore public Optional getAreSyncsDisabled() { + if (areSyncsDisabled == null) { + return Optional.empty(); + } return areSyncsDisabled; } /** * @return A JSON object containing integration-specific configuration options. */ - @JsonProperty("integration_specific_config") + @JsonIgnore public Optional> getIntegrationSpecificConfig() { + if (integrationSpecificConfig == null) { + return Optional.empty(); + } + return integrationSpecificConfig; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration") + private Optional _getIntegration() { + return integration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("should_create_magic_link_url") + private Optional _getShouldCreateMagicLinkUrl() { + return shouldCreateMagicLinkUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("hide_admin_magic_link") + private Optional _getHideAdminMagicLink() { + return hideAdminMagicLink; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("common_models") + private Optional> _getCommonModels() { + return commonModels; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category_common_model_scopes") + private Optional>>> + _getCategoryCommonModelScopes() { + return categoryCommonModelScopes; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("language") + private Optional _getLanguage() { + return language; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("are_syncs_disabled") + private Optional _getAreSyncsDisabled() { + return areSyncsDisabled; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_specific_config") + private Optional> _getIntegrationSpecificConfig() { return integrationSpecificConfig; } @@ -290,6 +366,8 @@ public interface _FinalStage { _FinalStage integration(String integration); + _FinalStage integration(Nullable 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.

          */ @@ -304,6 +382,8 @@ public interface _FinalStage { _FinalStage shouldCreateMagicLinkUrl(Boolean shouldCreateMagicLinkUrl); + _FinalStage shouldCreateMagicLinkUrl(Nullable 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.

          */ @@ -311,6 +391,8 @@ public interface _FinalStage { _FinalStage hideAdminMagicLink(Boolean hideAdminMagicLink); + _FinalStage hideAdminMagicLink(Nullable 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.

          */ @@ -318,6 +400,8 @@ public interface _FinalStage { _FinalStage commonModels(List commonModels); + _FinalStage commonModels(Nullable> 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.

          */ @@ -328,6 +412,10 @@ _FinalStage categoryCommonModelScopes( _FinalStage categoryCommonModelScopes( Map>> categoryCommonModelScopes); + _FinalStage categoryCommonModelScopes( + Nullable>>> + categoryCommonModelScopes); + /** *

          The following subset of IETF language tags can be used to configure localization.

          *
            @@ -339,6 +427,8 @@ _FinalStage categoryCommonModelScopes( _FinalStage language(EndUserDetailsRequestLanguage language); + _FinalStage language(Nullable language); + /** *

            The boolean that indicates whether initial, periodic, and force syncs will be disabled.

            */ @@ -346,12 +436,16 @@ _FinalStage categoryCommonModelScopes( _FinalStage areSyncsDisabled(Boolean areSyncsDisabled); + _FinalStage areSyncsDisabled(Nullable areSyncsDisabled); + /** *

            A JSON object containing integration-specific configuration options.

            */ _FinalStage integrationSpecificConfig(Optional> integrationSpecificConfig); _FinalStage integrationSpecificConfig(Map integrationSpecificConfig); + + _FinalStage integrationSpecificConfig(Nullable> integrationSpecificConfig); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -443,6 +537,22 @@ public _FinalStage endUserOriginId(@NotNull String endUserOriginId) { 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(Nullable> integrationSpecificConfig) { + if (integrationSpecificConfig.isNull()) { + this.integrationSpecificConfig = null; + } else if (integrationSpecificConfig.isEmpty()) { + this.integrationSpecificConfig = Optional.empty(); + } else { + this.integrationSpecificConfig = Optional.of(integrationSpecificConfig.get()); + } + return this; + } + /** *

            A JSON object containing integration-specific configuration options.

            * @return Reference to {@code this} so that method calls can be chained together. @@ -463,6 +573,22 @@ public _FinalStage integrationSpecificConfig(Optional> int 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(Nullable areSyncsDisabled) { + if (areSyncsDisabled.isNull()) { + this.areSyncsDisabled = null; + } else if (areSyncsDisabled.isEmpty()) { + this.areSyncsDisabled = Optional.empty(); + } else { + this.areSyncsDisabled = Optional.of(areSyncsDisabled.get()); + } + 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. @@ -483,6 +609,26 @@ public _FinalStage areSyncsDisabled(Optional areSyncsDisabled) { return this; } + /** + *

            The following subset of IETF language tags can be used to configure localization.

            + *
              + *
            • en - en
            • + *
            • de - de
            • + *
            + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage language(Nullable language) { + if (language.isNull()) { + this.language = null; + } else if (language.isEmpty()) { + this.language = Optional.empty(); + } else { + this.language = Optional.of(language.get()); + } + return this; + } + /** *

            The following subset of IETF language tags can be used to configure localization.

            *
              @@ -511,6 +657,24 @@ public _FinalStage language(Optional 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( + Nullable>>> + categoryCommonModelScopes) { + if (categoryCommonModelScopes.isNull()) { + this.categoryCommonModelScopes = null; + } else if (categoryCommonModelScopes.isEmpty()) { + this.categoryCommonModelScopes = Optional.empty(); + } else { + this.categoryCommonModelScopes = Optional.of(categoryCommonModelScopes.get()); + } + 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. @@ -534,6 +698,22 @@ public _FinalStage 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(Nullable> commonModels) { + if (commonModels.isNull()) { + this.commonModels = null; + } else if (commonModels.isEmpty()) { + this.commonModels = Optional.empty(); + } else { + this.commonModels = Optional.of(commonModels.get()); + } + 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. @@ -554,6 +734,22 @@ public _FinalStage commonModels(Optional> com 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(Nullable hideAdminMagicLink) { + if (hideAdminMagicLink.isNull()) { + this.hideAdminMagicLink = null; + } else if (hideAdminMagicLink.isEmpty()) { + this.hideAdminMagicLink = Optional.empty(); + } else { + this.hideAdminMagicLink = Optional.of(hideAdminMagicLink.get()); + } + 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. @@ -574,6 +770,22 @@ public _FinalStage hideAdminMagicLink(Optional 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(Nullable shouldCreateMagicLinkUrl) { + if (shouldCreateMagicLinkUrl.isNull()) { + this.shouldCreateMagicLinkUrl = null; + } else if (shouldCreateMagicLinkUrl.isEmpty()) { + this.shouldCreateMagicLinkUrl = Optional.empty(); + } else { + this.shouldCreateMagicLinkUrl = Optional.of(shouldCreateMagicLinkUrl.get()); + } + 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. @@ -614,6 +826,22 @@ public _FinalStage linkExpiryMins(Optional 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(Nullable integration) { + if (integration.isNull()) { + this.integration = null; + } else if (integration.isEmpty()) { + this.integration = Optional.empty(); + } else { + this.integration = Optional.of(integration.get()); + } + 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. diff --git a/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java index ddb62b833..cec883746 100644 --- a/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java +++ b/src/main/java/com/merge/api/ticketing/types/ExternalTargetFieldApi.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -39,18 +42,45 @@ private ExternalTargetFieldApi( this.additionalProperties = additionalProperties; } - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } - @JsonProperty("is_mapped") + @JsonIgnore public Optional getIsMapped() { + if (isMapped == null) { + return Optional.empty(); + } + return isMapped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_mapped") + private Optional _getIsMapped() { return isMapped; } @@ -114,6 +144,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + @JsonSetter(value = "description", nulls = Nulls.SKIP) public Builder description(Optional description) { this.description = description; @@ -125,6 +166,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + @JsonSetter(value = "is_mapped", nulls = Nulls.SKIP) public Builder isMapped(Optional isMapped) { this.isMapped = isMapped; @@ -136,6 +188,17 @@ public Builder isMapped(String isMapped) { return this; } + public Builder isMapped(Nullable isMapped) { + if (isMapped.isNull()) { + this.isMapped = null; + } else if (isMapped.isEmpty()) { + this.isMapped = Optional.empty(); + } else { + this.isMapped = Optional.of(isMapped.get()); + } + return this; + } + public ExternalTargetFieldApi build() { return new ExternalTargetFieldApi(name, description, isMapped, additionalProperties); } 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..2b89f4adc 100644 --- a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstance.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -53,13 +56,31 @@ public Optional getIsIntegrationWide() { return isIntegrationWide; } - @JsonProperty("target_field") + @JsonIgnore public Optional getTargetField() { + if (targetField == null) { + return Optional.empty(); + } return targetField; } - @JsonProperty("remote_field") + @JsonIgnore public Optional getRemoteField() { + if (remoteField == null) { + return Optional.empty(); + } + return remoteField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("target_field") + private Optional _getTargetField() { + return targetField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_field") + private Optional _getRemoteField() { return remoteField; } @@ -151,6 +172,17 @@ public Builder targetField(FieldMappingApiInstanceTargetField targetField) { return this; } + public Builder targetField(Nullable targetField) { + if (targetField.isNull()) { + this.targetField = null; + } else if (targetField.isEmpty()) { + this.targetField = Optional.empty(); + } else { + this.targetField = Optional.of(targetField.get()); + } + return this; + } + @JsonSetter(value = "remote_field", nulls = Nulls.SKIP) public Builder remoteField(Optional remoteField) { this.remoteField = remoteField; @@ -162,6 +194,17 @@ public Builder remoteField(FieldMappingApiInstanceRemoteField remoteField) { return this; } + public Builder remoteField(Nullable remoteField) { + if (remoteField.isNull()) { + this.remoteField = null; + } else if (remoteField.isEmpty()) { + this.remoteField = Optional.empty(); + } else { + this.remoteField = Optional.of(remoteField.get()); + } + return this; + } + public FieldMappingApiInstance build() { return new FieldMappingApiInstance(id, isIntegrationWide, targetField, remoteField, additionalProperties); } diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java index 72437f505..cfc3774be 100644 --- a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -41,13 +44,19 @@ private FieldMappingApiInstanceRemoteField( this.additionalProperties = additionalProperties; } - @JsonProperty("remote_key_name") + @JsonIgnore public Optional getRemoteKeyName() { + if (remoteKeyName == null) { + return Optional.empty(); + } return remoteKeyName; } - @JsonProperty("schema") + @JsonIgnore public Optional> getSchema() { + if (schema == null) { + return Optional.empty(); + } return schema; } @@ -56,6 +65,18 @@ public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo getRemoteEndpointInf return remoteEndpointInfo; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_key_name") + private Optional _getRemoteKeyName() { + return remoteKeyName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("schema") + private Optional> _getSchema() { + return schema; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -102,9 +123,13 @@ public interface _FinalStage { _FinalStage remoteKeyName(String remoteKeyName); + _FinalStage remoteKeyName(Nullable remoteKeyName); + _FinalStage schema(Optional> schema); _FinalStage schema(Map schema); + + _FinalStage schema(Nullable> schema); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -136,6 +161,18 @@ public _FinalStage remoteEndpointInfo( return this; } + @java.lang.Override + public _FinalStage schema(Nullable> schema) { + if (schema.isNull()) { + this.schema = null; + } else if (schema.isEmpty()) { + this.schema = Optional.empty(); + } else { + this.schema = Optional.of(schema.get()); + } + return this; + } + @java.lang.Override public _FinalStage schema(Map schema) { this.schema = Optional.ofNullable(schema); @@ -149,6 +186,18 @@ public _FinalStage schema(Optional> schema) { return this; } + @java.lang.Override + public _FinalStage remoteKeyName(Nullable remoteKeyName) { + if (remoteKeyName.isNull()) { + this.remoteKeyName = null; + } else if (remoteKeyName.isEmpty()) { + this.remoteKeyName = Optional.empty(); + } else { + this.remoteKeyName = Optional.of(remoteKeyName.get()); + } + return this; + } + @java.lang.Override public _FinalStage remoteKeyName(String remoteKeyName) { this.remoteKeyName = Optional.ofNullable(remoteKeyName); diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java index dbb8a2329..4660cde61 100644 --- a/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,18 +43,45 @@ private FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( this.additionalProperties = additionalProperties; } - @JsonProperty("method") + @JsonIgnore public Optional getMethod() { + if (method == null) { + return Optional.empty(); + } return method; } - @JsonProperty("url_path") + @JsonIgnore public Optional getUrlPath() { + if (urlPath == null) { + return Optional.empty(); + } return urlPath; } - @JsonProperty("field_traversal_path") + @JsonIgnore public Optional> getFieldTraversalPath() { + if (fieldTraversalPath == null) { + return Optional.empty(); + } + return fieldTraversalPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("method") + private Optional _getMethod() { + return method; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("url_path") + private Optional _getUrlPath() { + return urlPath; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_traversal_path") + private Optional> _getFieldTraversalPath() { return fieldTraversalPath; } @@ -118,6 +148,17 @@ public Builder method(String method) { return this; } + public Builder method(Nullable method) { + if (method.isNull()) { + this.method = null; + } else if (method.isEmpty()) { + this.method = Optional.empty(); + } else { + this.method = Optional.of(method.get()); + } + return this; + } + @JsonSetter(value = "url_path", nulls = Nulls.SKIP) public Builder urlPath(Optional urlPath) { this.urlPath = urlPath; @@ -129,6 +170,17 @@ public Builder urlPath(String urlPath) { return this; } + public Builder urlPath(Nullable urlPath) { + if (urlPath.isNull()) { + this.urlPath = null; + } else if (urlPath.isEmpty()) { + this.urlPath = Optional.empty(); + } else { + this.urlPath = Optional.of(urlPath.get()); + } + return this; + } + @JsonSetter(value = "field_traversal_path", nulls = Nulls.SKIP) public Builder fieldTraversalPath(Optional> fieldTraversalPath) { this.fieldTraversalPath = fieldTraversalPath; @@ -140,6 +192,17 @@ public Builder fieldTraversalPath(List fieldTraversalPath) { return this; } + public Builder fieldTraversalPath(Nullable> fieldTraversalPath) { + if (fieldTraversalPath.isNull()) { + this.fieldTraversalPath = null; + } else if (fieldTraversalPath.isEmpty()) { + this.fieldTraversalPath = Optional.empty(); + } else { + this.fieldTraversalPath = Optional.of(fieldTraversalPath.get()); + } + return this; + } + public FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo build() { return new FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo( method, urlPath, fieldTraversalPath, additionalProperties); diff --git a/src/main/java/com/merge/api/ticketing/types/FieldMappingsDestroyRequest.java b/src/main/java/com/merge/api/ticketing/types/FieldMappingsDestroyRequest.java new file mode 100644 index 000000000..a2936fd56 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/FieldMappingsDestroyRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FieldMappingsDestroyRequest.Builder.class) +public final class FieldMappingsDestroyRequest { + private final Map additionalProperties; + + private FieldMappingsDestroyRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FieldMappingsDestroyRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(FieldMappingsDestroyRequest other) { + return this; + } + + public FieldMappingsDestroyRequest build() { + return new FieldMappingsDestroyRequest(additionalProperties); + } + } +} diff --git a/src/main/java/com/merge/api/ticketing/types/Issue.java b/src/main/java/com/merge/api/ticketing/types/Issue.java index 6d9028268..ae39315a3 100644 --- a/src/main/java/com/merge/api/ticketing/types/Issue.java +++ b/src/main/java/com/merge/api/ticketing/types/Issue.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,13 +93,19 @@ public Optional> getEndUser() { return endUser; } - @JsonProperty("first_incident_time") + @JsonIgnore public Optional getFirstIncidentTime() { + if (firstIncidentTime == null) { + return Optional.empty(); + } return firstIncidentTime; } - @JsonProperty("last_incident_time") + @JsonIgnore public Optional getLastIncidentTime() { + if (lastIncidentTime == null) { + return Optional.empty(); + } return lastIncidentTime; } @@ -110,6 +119,18 @@ public Optional> getErrorDetails() { return errorDetails; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time") + private Optional _getFirstIncidentTime() { + return firstIncidentTime; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time") + private Optional _getLastIncidentTime() { + return lastIncidentTime; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -186,10 +207,14 @@ public interface _FinalStage { _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime); + _FinalStage firstIncidentTime(Nullable firstIncidentTime); + _FinalStage lastIncidentTime(Optional lastIncidentTime); _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime); + _FinalStage lastIncidentTime(Nullable lastIncidentTime); + _FinalStage isMuted(Optional isMuted); _FinalStage isMuted(Boolean isMuted); @@ -268,6 +293,18 @@ public _FinalStage isMuted(Optional isMuted) { return this; } + @java.lang.Override + public _FinalStage lastIncidentTime(Nullable lastIncidentTime) { + if (lastIncidentTime.isNull()) { + this.lastIncidentTime = null; + } else if (lastIncidentTime.isEmpty()) { + this.lastIncidentTime = Optional.empty(); + } else { + this.lastIncidentTime = Optional.of(lastIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage lastIncidentTime(OffsetDateTime lastIncidentTime) { this.lastIncidentTime = Optional.ofNullable(lastIncidentTime); @@ -281,6 +318,18 @@ public _FinalStage lastIncidentTime(Optional lastIncidentTime) { return this; } + @java.lang.Override + public _FinalStage firstIncidentTime(Nullable firstIncidentTime) { + if (firstIncidentTime.isNull()) { + this.firstIncidentTime = null; + } else if (firstIncidentTime.isEmpty()) { + this.firstIncidentTime = Optional.empty(); + } else { + this.firstIncidentTime = Optional.of(firstIncidentTime.get()); + } + return this; + } + @java.lang.Override public _FinalStage firstIncidentTime(OffsetDateTime firstIncidentTime) { this.firstIncidentTime = Optional.ofNullable(firstIncidentTime); 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..7c45cbcc9 100644 --- a/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/IssuesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -113,16 +116,22 @@ public Optional getEndUserOrganizationName() { /** * @return If provided, will only return issues whose first incident time was after this datetime. */ - @JsonProperty("first_incident_time_after") + @JsonIgnore public Optional getFirstIncidentTimeAfter() { + if (firstIncidentTimeAfter == null) { + return Optional.empty(); + } return firstIncidentTimeAfter; } /** * @return If provided, will only return issues whose first incident time was before this datetime. */ - @JsonProperty("first_incident_time_before") + @JsonIgnore public Optional getFirstIncidentTimeBefore() { + if (firstIncidentTimeBefore == null) { + return Optional.empty(); + } return firstIncidentTimeBefore; } @@ -142,16 +151,22 @@ public Optional getIntegrationName() { /** * @return If provided, will only return issues whose last incident time was after this datetime. */ - @JsonProperty("last_incident_time_after") + @JsonIgnore public Optional getLastIncidentTimeAfter() { + if (lastIncidentTimeAfter == null) { + return Optional.empty(); + } return lastIncidentTimeAfter; } /** * @return If provided, will only return issues whose last incident time was before this datetime. */ - @JsonProperty("last_incident_time_before") + @JsonIgnore public Optional getLastIncidentTimeBefore() { + if (lastIncidentTimeBefore == null) { + return Optional.empty(); + } return lastIncidentTimeBefore; } @@ -191,6 +206,30 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_after") + private Optional _getFirstIncidentTimeAfter() { + return firstIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("first_incident_time_before") + private Optional _getFirstIncidentTimeBefore() { + return firstIncidentTimeBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_after") + private Optional _getLastIncidentTimeAfter() { + return lastIncidentTimeAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_incident_time_before") + private Optional _getLastIncidentTimeBefore() { + return lastIncidentTimeBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -364,6 +403,17 @@ public Builder firstIncidentTimeAfter(OffsetDateTime firstIncidentTimeAfter) { return this; } + public Builder firstIncidentTimeAfter(Nullable firstIncidentTimeAfter) { + if (firstIncidentTimeAfter.isNull()) { + this.firstIncidentTimeAfter = null; + } else if (firstIncidentTimeAfter.isEmpty()) { + this.firstIncidentTimeAfter = Optional.empty(); + } else { + this.firstIncidentTimeAfter = Optional.of(firstIncidentTimeAfter.get()); + } + return this; + } + /** *

              If provided, will only return issues whose first incident time was before this datetime.

              */ @@ -378,6 +428,17 @@ public Builder firstIncidentTimeBefore(OffsetDateTime firstIncidentTimeBefore) { return this; } + public Builder firstIncidentTimeBefore(Nullable firstIncidentTimeBefore) { + if (firstIncidentTimeBefore.isNull()) { + this.firstIncidentTimeBefore = null; + } else if (firstIncidentTimeBefore.isEmpty()) { + this.firstIncidentTimeBefore = Optional.empty(); + } else { + this.firstIncidentTimeBefore = Optional.of(firstIncidentTimeBefore.get()); + } + return this; + } + /** *

              If true, will include muted issues

              */ @@ -417,6 +478,17 @@ public Builder lastIncidentTimeAfter(OffsetDateTime lastIncidentTimeAfter) { return this; } + public Builder lastIncidentTimeAfter(Nullable lastIncidentTimeAfter) { + if (lastIncidentTimeAfter.isNull()) { + this.lastIncidentTimeAfter = null; + } else if (lastIncidentTimeAfter.isEmpty()) { + this.lastIncidentTimeAfter = Optional.empty(); + } else { + this.lastIncidentTimeAfter = Optional.of(lastIncidentTimeAfter.get()); + } + return this; + } + /** *

              If provided, will only return issues whose last incident time was before this datetime.

              */ @@ -431,6 +503,17 @@ public Builder lastIncidentTimeBefore(OffsetDateTime lastIncidentTimeBefore) { return this; } + public Builder lastIncidentTimeBefore(Nullable lastIncidentTimeBefore) { + if (lastIncidentTimeBefore.isNull()) { + this.lastIncidentTimeBefore = null; + } else if (lastIncidentTimeBefore.isEmpty()) { + this.lastIncidentTimeBefore = Optional.empty(); + } else { + this.lastIncidentTimeBefore = Optional.of(lastIncidentTimeBefore.get()); + } + return this; + } + /** *

              If provided, will only include issues pertaining to the linked account passed in.

              */ diff --git a/src/main/java/com/merge/api/ticketing/types/IssuesRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/IssuesRetrieveRequest.java new file mode 100644 index 000000000..c66423d33 --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/IssuesRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = IssuesRetrieveRequest.Builder.class) +public final class IssuesRetrieveRequest { + private final Map additionalProperties; + + private IssuesRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof IssuesRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(IssuesRetrieveRequest other) { + return this; + } + + public IssuesRetrieveRequest build() { + return new IssuesRetrieveRequest(additionalProperties); + } + } +} 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..7e7611198 100644 --- a/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/LinkedAccountsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -91,8 +94,11 @@ private LinkedAccountsListRequest( *
            • filestorage - filestorage
            • *
            */ - @JsonProperty("category") + @JsonIgnore public Optional getCategory() { + if (category == null) { + return Optional.empty(); + } return category; } @@ -189,6 +195,12 @@ public Optional getStatus() { return status; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("category") + private Optional _getCategory() { + return category; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -316,6 +328,17 @@ public Builder category(LinkedAccountsListRequestCategory category) { return this; } + public Builder category(Nullable category) { + if (category.isNull()) { + this.category = null; + } else if (category.isEmpty()) { + this.category = Optional.empty(); + } else { + this.category = Optional.of(category.get()); + } + return this; + } + /** *

            The pagination cursor value.

            */ diff --git a/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java b/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java index 713754edd..74d2b40f8 100644 --- a/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/MultipartFormFieldRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -72,24 +75,51 @@ public String getData() { *
          • GZIP_BASE64 - GZIP_BASE64
          • *
          */ - @JsonProperty("encoding") + @JsonIgnore public Optional getEncoding() { + if (encoding == null) { + return Optional.empty(); + } return encoding; } /** * @return The file name of the form field, if the field is for a file. */ - @JsonProperty("file_name") + @JsonIgnore public Optional getFileName() { + if (fileName == null) { + return Optional.empty(); + } return fileName; } /** * @return The MIME type of the file, if the field is for a file. */ - @JsonProperty("content_type") + @JsonIgnore public Optional getContentType() { + if (contentType == null) { + return Optional.empty(); + } + return contentType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("encoding") + private Optional _getEncoding() { + return encoding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("file_name") + private Optional _getFileName() { + return fileName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("content_type") + private Optional _getContentType() { return contentType; } @@ -157,6 +187,8 @@ public interface _FinalStage { _FinalStage encoding(MultipartFormFieldRequestEncoding encoding); + _FinalStage encoding(Nullable encoding); + /** *

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

          */ @@ -164,12 +196,16 @@ public interface _FinalStage { _FinalStage fileName(String fileName); + _FinalStage fileName(Nullable fileName); + /** *

          The MIME type of the file, if the field is for a file.

          */ _FinalStage contentType(Optional contentType); _FinalStage contentType(String contentType); + + _FinalStage contentType(Nullable contentType); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -223,6 +259,22 @@ public _FinalStage data(@NotNull String 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(Nullable contentType) { + if (contentType.isNull()) { + this.contentType = null; + } else if (contentType.isEmpty()) { + this.contentType = Optional.empty(); + } else { + this.contentType = Optional.of(contentType.get()); + } + 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. @@ -243,6 +295,22 @@ public _FinalStage contentType(Optional 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(Nullable fileName) { + if (fileName.isNull()) { + this.fileName = null; + } else if (fileName.isEmpty()) { + this.fileName = Optional.empty(); + } else { + this.fileName = Optional.of(fileName.get()); + } + 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. @@ -263,6 +331,27 @@ public _FinalStage fileName(Optional fileName) { return this; } + /** + *

          The encoding of the value of data. Defaults to RAW if not defined.

          + *
            + *
          • RAW - RAW
          • + *
          • BASE64 - BASE64
          • + *
          • GZIP_BASE64 - GZIP_BASE64
          • + *
          + * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage encoding(Nullable encoding) { + if (encoding.isNull()) { + this.encoding = null; + } else if (encoding.isEmpty()) { + this.encoding = Optional.empty(); + } else { + this.encoding = Optional.of(encoding.get()); + } + return this; + } + /** *

          The encoding of the value of data. Defaults to RAW if not defined.

          *
            diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java index 9180b252b..da884e8b7 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountDetailsAndActionsList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountDetailsAndActionsList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -116,6 +137,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -127,6 +159,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java index e6ba43a4c..9bb72cf37 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAccountList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAccountList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java index bfe038945..925480453 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAttachmentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAttachmentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java index aaab1bf15..3ccc18ff8 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedAuditLogEventList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedAuditLogEventList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java index ada40624f..2fb17bafb 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedCollectionList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCollectionList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java index b3c662074..0b0433e77 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedCommentList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedCommentList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java index 89905d6e8..9b5e48b4d 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedContactList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedContactList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java index 854ea2aa2..c8255470e 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedIssueList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedIssueList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java index 93796a637..a13f76887 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedProjectList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedProjectList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java index f7263883e..91eb5a875 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedRemoteFieldClassList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRemoteFieldClassList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java index 8687b3868..3c0d96118 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedRoleList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedRoleList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java index 9576b2625..ced7fcb6f 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedSyncStatusList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedSyncStatusList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java index 9844ecc97..9c56338c9 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTagList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTagList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java index 524c048bc..8b9c9064d 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTeamList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTeamList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java index c73631887..68b95ff70 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedTicketList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedTicketList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java index 8d677e8bf..9805c4f96 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedUserList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedUserList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java b/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java index c3abc5e0d..d4ec51271 100644 --- a/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java +++ b/src/main/java/com/merge/api/ticketing/types/PaginatedViewerList.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -40,13 +43,19 @@ private PaginatedViewerList( this.additionalProperties = additionalProperties; } - @JsonProperty("next") + @JsonIgnore public Optional getNext() { + if (next == null) { + return Optional.empty(); + } return next; } - @JsonProperty("previous") + @JsonIgnore public Optional getPrevious() { + if (previous == null) { + return Optional.empty(); + } return previous; } @@ -55,6 +64,18 @@ public Optional> getResults() { return results; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next") + private Optional _getNext() { + return next; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("previous") + private Optional _getPrevious() { + return previous; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -115,6 +136,17 @@ public Builder next(String next) { return this; } + public Builder next(Nullable next) { + if (next.isNull()) { + this.next = null; + } else if (next.isEmpty()) { + this.next = Optional.empty(); + } else { + this.next = Optional.of(next.get()); + } + return this; + } + @JsonSetter(value = "previous", nulls = Nulls.SKIP) public Builder previous(Optional previous) { this.previous = previous; @@ -126,6 +158,17 @@ public Builder previous(String previous) { return this; } + public Builder previous(Nullable previous) { + if (previous.isNull()) { + this.previous = null; + } else if (previous.isEmpty()) { + this.previous = Optional.empty(); + } else { + this.previous = Optional.of(previous.get()); + } + return this; + } + @JsonSetter(value = "results", nulls = Nulls.SKIP) public Builder results(Optional> results) { this.results = results; diff --git a/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java b/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java index 2b6f65496..e5e8a7ad4 100644 --- a/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/PatchedTicketRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -117,8 +120,11 @@ private PatchedTicketRequest( /** * @return The ticket's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -141,16 +147,22 @@ public Optional>> getAssignedTeams() { /** * @return The user who created this ticket. */ - @JsonProperty("creator") + @JsonIgnore public Optional getCreator() { + if (creator == null) { + return Optional.empty(); + } return creator; } /** * @return The ticket's due date. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -163,16 +175,22 @@ public Optional getDueDate() { *
          • ON_HOLD - ON_HOLD
          • *
          */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -187,32 +205,44 @@ public Optional>> getCollections() { /** * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. */ - @JsonProperty("ticket_type") + @JsonIgnore public Optional getTicketType() { + if (ticketType == null) { + return Optional.empty(); + } return ticketType; } /** * @return The account associated with the ticket. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact associated with the ticket. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The ticket's parent ticket. */ - @JsonProperty("parent_ticket") + @JsonIgnore public Optional getParentTicket() { + if (parentTicket == null) { + return Optional.empty(); + } return parentTicket; } @@ -225,8 +255,11 @@ public Optional getParentTicket() { *
        • COLLECTION - COLLECTION
        • *
        */ - @JsonProperty("access_level") + @JsonIgnore public Optional getAccessLevel() { + if (accessLevel == null) { + return Optional.empty(); + } return accessLevel; } @@ -243,16 +276,22 @@ public Optional>> getRoles() { /** * @return When the ticket was completed. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } return completedAt; } /** * @return The 3rd party url of the Ticket. */ - @JsonProperty("ticket_url") + @JsonIgnore public Optional getTicketUrl() { + if (ticketUrl == null) { + return Optional.empty(); + } return ticketUrl; } @@ -270,13 +309,19 @@ public Optional getPriority() { return priority; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -285,6 +330,90 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("creator") + private Optional _getCreator() { + return creator; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_type") + private Optional _getTicketType() { + return ticketType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_ticket") + private Optional _getParentTicket() { + return parentTicket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("access_level") + private Optional _getAccessLevel() { + return accessLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_url") + private Optional _getTicketUrl() { + return ticketUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -443,6 +572,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        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.

        */ @@ -485,6 +625,17 @@ public Builder creator(String creator) { return this; } + public Builder creator(Nullable creator) { + if (creator.isNull()) { + this.creator = null; + } else if (creator.isEmpty()) { + this.creator = Optional.empty(); + } else { + this.creator = Optional.of(creator.get()); + } + return this; + } + /** *

        The ticket's due date.

        */ @@ -499,6 +650,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

        The current status of the ticket.

        *
          @@ -519,6 +681,17 @@ public Builder status(PatchedTicketRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The ticket’s description. HTML version of description is mapped if supported by the third-party platform.

          */ @@ -533,6 +706,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The Collections that this Ticket is included in.

          */ @@ -561,6 +745,17 @@ public Builder ticketType(String ticketType) { return this; } + public Builder ticketType(Nullable ticketType) { + if (ticketType.isNull()) { + this.ticketType = null; + } else if (ticketType.isEmpty()) { + this.ticketType = Optional.empty(); + } else { + this.ticketType = Optional.of(ticketType.get()); + } + return this; + } + /** *

          The account associated with the ticket.

          */ @@ -575,6 +770,17 @@ public Builder account(String account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

          The contact associated with the ticket.

          */ @@ -589,6 +795,17 @@ public Builder contact(String contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

          The ticket's parent ticket.

          */ @@ -603,6 +820,17 @@ public Builder parentTicket(String parentTicket) { return this; } + public Builder parentTicket(Nullable parentTicket) { + if (parentTicket.isNull()) { + this.parentTicket = null; + } else if (parentTicket.isEmpty()) { + this.parentTicket = Optional.empty(); + } else { + this.parentTicket = Optional.of(parentTicket.get()); + } + return this; + } + /** *

          The description of who is able to access a given ticket, or where access is inherited from.

          *
            @@ -623,6 +851,17 @@ public Builder accessLevel(PatchedTicketRequestAccessLevel accessLevel) { return this; } + public Builder accessLevel(Nullable accessLevel) { + if (accessLevel.isNull()) { + this.accessLevel = null; + } else if (accessLevel.isEmpty()) { + this.accessLevel = Optional.empty(); + } else { + this.accessLevel = Optional.of(accessLevel.get()); + } + return this; + } + @JsonSetter(value = "tags", nulls = Nulls.SKIP) public Builder tags(Optional>> tags) { this.tags = tags; @@ -659,6 +898,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + /** *

            The 3rd party url of the Ticket.

            */ @@ -673,6 +923,17 @@ public Builder ticketUrl(String ticketUrl) { return this; } + public Builder ticketUrl(Nullable ticketUrl) { + if (ticketUrl.isNull()) { + this.ticketUrl = null; + } else if (ticketUrl.isEmpty()) { + this.ticketUrl = Optional.empty(); + } else { + this.ticketUrl = Optional.of(ticketUrl.get()); + } + return this; + } + /** *

            The priority or urgency of the Ticket.

            *
              @@ -704,6 +965,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -715,6 +987,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/ticketing/types/Project.java b/src/main/java/com/merge/api/ticketing/types/Project.java index 6c8b7f97b..b6085e5f5 100644 --- a/src/main/java/com/merge/api/ticketing/types/Project.java +++ b/src/main/java/com/merge/api/ticketing/types/Project.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,16 +104,22 @@ public Optional getModifiedAt() { /** * @return The project's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The project's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -119,13 +131,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -238,6 +286,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

              The datetime that this object was created by Merge.

              */ @@ -280,6 +339,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

              The project's description.

              */ @@ -294,6 +364,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + 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.

              */ @@ -319,6 +400,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -330,6 +422,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Project build() { return new Project( id, diff --git a/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java b/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java index 1fd1d2dfa..69d100aa7 100644 --- a/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/ProjectsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public ProjectsListRequest build() { return new ProjectsListRequest( createdAfter, 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/RemoteField.java b/src/main/java/com/merge/api/ticketing/types/RemoteField.java index 7202b7c57..5e53a1ee6 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteField.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteField.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRemoteFieldClass remoteF return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java index ff61299e5..520839e7d 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldApi.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.LinkedHashMap; @@ -70,18 +73,45 @@ public RemoteEndpointInfo getRemoteEndpointInfo() { return remoteEndpointInfo; } - @JsonProperty("example_values") + @JsonIgnore public Optional> getExampleValues() { + if (exampleValues == null) { + return Optional.empty(); + } return exampleValues; } - @JsonProperty("advanced_metadata") + @JsonIgnore public Optional getAdvancedMetadata() { + if (advancedMetadata == null) { + return Optional.empty(); + } return advancedMetadata; } - @JsonProperty("coverage") + @JsonIgnore public Optional getCoverage() { + if (coverage == null) { + return Optional.empty(); + } + return coverage; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("example_values") + private Optional> _getExampleValues() { + return exampleValues; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("advanced_metadata") + private Optional _getAdvancedMetadata() { + return advancedMetadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("coverage") + private Optional _getCoverage() { return coverage; } @@ -148,13 +178,19 @@ public interface _FinalStage { _FinalStage exampleValues(List exampleValues); + _FinalStage exampleValues(Nullable> exampleValues); + _FinalStage advancedMetadata(Optional advancedMetadata); _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata); + _FinalStage advancedMetadata(Nullable advancedMetadata); + _FinalStage coverage(Optional coverage); _FinalStage coverage(RemoteFieldApiCoverage coverage); + + _FinalStage coverage(Nullable coverage); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -201,6 +237,18 @@ public _FinalStage remoteEndpointInfo(@NotNull RemoteEndpointInfo remoteEndpoint return this; } + @java.lang.Override + public _FinalStage coverage(Nullable coverage) { + if (coverage.isNull()) { + this.coverage = null; + } else if (coverage.isEmpty()) { + this.coverage = Optional.empty(); + } else { + this.coverage = Optional.of(coverage.get()); + } + return this; + } + @java.lang.Override public _FinalStage coverage(RemoteFieldApiCoverage coverage) { this.coverage = Optional.ofNullable(coverage); @@ -214,6 +262,18 @@ public _FinalStage coverage(Optional coverage) { return this; } + @java.lang.Override + public _FinalStage advancedMetadata(Nullable advancedMetadata) { + if (advancedMetadata.isNull()) { + this.advancedMetadata = null; + } else if (advancedMetadata.isEmpty()) { + this.advancedMetadata = Optional.empty(); + } else { + this.advancedMetadata = Optional.of(advancedMetadata.get()); + } + return this; + } + @java.lang.Override public _FinalStage advancedMetadata(AdvancedMetadata advancedMetadata) { this.advancedMetadata = Optional.ofNullable(advancedMetadata); @@ -227,6 +287,18 @@ public _FinalStage advancedMetadata(Optional advancedMetadata) return this; } + @java.lang.Override + public _FinalStage exampleValues(Nullable> exampleValues) { + if (exampleValues.isNull()) { + this.exampleValues = null; + } else if (exampleValues.isEmpty()) { + this.exampleValues = Optional.empty(); + } else { + this.exampleValues = Optional.of(exampleValues.get()); + } + return this; + } + @java.lang.Override public _FinalStage exampleValues(List exampleValues) { this.exampleValues = Optional.ofNullable(exampleValues); diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java index 1abd09e7b..f36afa888 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClass.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.List; @@ -117,8 +120,11 @@ public Optional getFieldFormat() { return fieldFormat; } - @JsonProperty("field_choices") + @JsonIgnore public Optional> getFieldChoices() { + if (fieldChoices == null) { + return Optional.empty(); + } return fieldChoices; } @@ -127,6 +133,12 @@ public Optional getItemSchema() { return itemSchema; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_choices") + private Optional> _getFieldChoices() { + return fieldChoices; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -331,6 +343,17 @@ public Builder fieldChoices(List fieldChoices) return this; } + public Builder fieldChoices(Nullable> fieldChoices) { + if (fieldChoices.isNull()) { + this.fieldChoices = null; + } else if (fieldChoices.isEmpty()) { + this.fieldChoices = Optional.empty(); + } else { + this.fieldChoices = Optional.of(fieldChoices.get()); + } + return this; + } + @JsonSetter(value = "item_schema", nulls = Nulls.SKIP) public Builder itemSchema(Optional itemSchema) { this.itemSchema = itemSchema; diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java index a32632a2c..9c7500ad3 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldClassFieldChoicesItem.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -34,13 +37,31 @@ private RemoteFieldClassFieldChoicesItem( this.additionalProperties = additionalProperties; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } return value; } - @JsonProperty("display_name") + @JsonIgnore public Optional getDisplayName() { + if (displayName == null) { + return Optional.empty(); + } + return displayName; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("display_name") + private Optional _getDisplayName() { return displayName; } @@ -101,6 +122,17 @@ public Builder value(JsonNode value) { return this; } + public Builder value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @JsonSetter(value = "display_name", nulls = Nulls.SKIP) public Builder displayName(Optional displayName) { this.displayName = displayName; @@ -112,6 +144,17 @@ public Builder displayName(String displayName) { return this; } + public Builder displayName(Nullable displayName) { + if (displayName.isNull()) { + this.displayName = null; + } else if (displayName.isEmpty()) { + this.displayName = Optional.empty(); + } else { + this.displayName = Optional.of(displayName.get()); + } + return this; + } + public RemoteFieldClassFieldChoicesItem build() { return new RemoteFieldClassFieldChoicesItem(value, displayName, additionalProperties); } diff --git a/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java index 8e7a697ea..e61e497e9 100644 --- a/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/RemoteFieldRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -42,8 +45,17 @@ public RemoteFieldRequestRemoteFieldClass getRemoteFieldClass() { return remoteFieldClass; } - @JsonProperty("value") + @JsonIgnore public Optional getValue() { + if (value == null) { + return Optional.empty(); + } + return value; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("value") + private Optional _getValue() { return value; } @@ -88,6 +100,8 @@ public interface _FinalStage { _FinalStage value(Optional value); _FinalStage value(JsonNode value); + + _FinalStage value(Nullable value); } @JsonIgnoreProperties(ignoreUnknown = true) @@ -115,6 +129,18 @@ public _FinalStage remoteFieldClass(@NotNull RemoteFieldRequestRemoteFieldClass return this; } + @java.lang.Override + public _FinalStage value(Nullable value) { + if (value.isNull()) { + this.value = null; + } else if (value.isEmpty()) { + this.value = Optional.empty(); + } else { + this.value = Optional.of(value.get()); + } + return this; + } + @java.lang.Override public _FinalStage value(JsonNode value) { this.value = Optional.ofNullable(value); diff --git a/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java b/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java index 8727ec619..fc1220f23 100644 --- a/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java +++ b/src/main/java/com/merge/api/ticketing/types/ResponseTypeEnum.java @@ -7,7 +7,7 @@ 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 BASE64GZIP = new ResponseTypeEnum(Value.BASE64GZIP, "BASE64_GZIP"); public static final ResponseTypeEnum JSON = new ResponseTypeEnum(Value.JSON, "JSON"); @@ -43,7 +43,7 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case BASE_64_GZIP: + case BASE64GZIP: return visitor.visitBase64Gzip(); case JSON: return visitor.visitJson(); @@ -57,7 +57,7 @@ public T visit(Visitor visitor) { public static ResponseTypeEnum valueOf(String value) { switch (value) { case "BASE64_GZIP": - return BASE_64_GZIP; + return BASE64GZIP; case "JSON": return JSON; default: @@ -68,7 +68,7 @@ public static ResponseTypeEnum valueOf(String value) { public enum Value { JSON, - BASE_64_GZIP, + BASE64GZIP, UNKNOWN } diff --git a/src/main/java/com/merge/api/ticketing/types/Role.java b/src/main/java/com/merge/api/ticketing/types/Role.java index 97574a29a..716a07a51 100644 --- a/src/main/java/com/merge/api/ticketing/types/Role.java +++ b/src/main/java/com/merge/api/ticketing/types/Role.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -78,8 +81,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -102,16 +108,22 @@ public Optional getModifiedAt() { /** * @return The name of the Role. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The set of actions that a User with this Role can perform. Possible enum values include: VIEW, CREATE, EDIT, DELETE, CLOSE, and ASSIGN. */ - @JsonProperty("ticket_actions") + @JsonIgnore public Optional>> getTicketActions() { + if (ticketActions == null) { + return Optional.empty(); + } return ticketActions; } @@ -123,8 +135,11 @@ public Optional>> getTicketActions() { *
            • TEAM_ONLY - TEAM_ONLY
            • *
            */ - @JsonProperty("ticket_access") + @JsonIgnore public Optional getTicketAccess() { + if (ticketAccess == null) { + return Optional.empty(); + } return ticketAccess; } @@ -136,13 +151,55 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_actions") + private Optional>> _getTicketActions() { + return ticketActions; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_access") + private Optional _getTicketAccess() { + return ticketAccess; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -260,6 +317,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

            The datetime that this object was created by Merge.

            */ @@ -302,6 +370,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

            The set of actions that a User with this Role can perform. Possible enum values include: VIEW, CREATE, EDIT, DELETE, CLOSE, and ASSIGN.

            */ @@ -316,6 +395,17 @@ public Builder ticketActions(List> ticketActions return this; } + public Builder ticketActions(Nullable>> ticketActions) { + if (ticketActions.isNull()) { + this.ticketActions = null; + } else if (ticketActions.isEmpty()) { + this.ticketActions = Optional.empty(); + } else { + this.ticketActions = Optional.of(ticketActions.get()); + } + return this; + } + /** *

            The level of Ticket access that a User with this Role can perform.

            *
              @@ -335,6 +425,17 @@ public Builder ticketAccess(RoleTicketAccess ticketAccess) { return this; } + public Builder ticketAccess(Nullable ticketAccess) { + if (ticketAccess.isNull()) { + this.ticketAccess = null; + } else if (ticketAccess.isEmpty()) { + this.ticketAccess = Optional.empty(); + } else { + this.ticketAccess = Optional.of(ticketAccess.get()); + } + 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.

              */ @@ -360,6 +461,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -371,6 +483,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Role build() { return new Role( id, 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..2314ab8e8 100644 --- a/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/RolesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public RolesListRequest build() { return new RolesListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ticketing/types/Tag.java b/src/main/java/com/merge/api/ticketing/types/Tag.java index 31463e518..db19f8207 100644 --- a/src/main/java/com/merge/api/ticketing/types/Tag.java +++ b/src/main/java/com/merge/api/ticketing/types/Tag.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -65,8 +68,11 @@ private Tag( /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -94,8 +100,11 @@ public Optional getId() { /** * @return The tag's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -107,13 +116,43 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -210,6 +249,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

              The datetime that this object was created by Merge.

              */ @@ -263,6 +313,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + 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.

              */ @@ -288,6 +349,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -299,6 +371,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Tag build() { return new Tag( remoteId, 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..6964baa0d 100644 --- a/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TagsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TagsListRequest build() { return new TagsListRequest( createdAfter, diff --git a/src/main/java/com/merge/api/ticketing/types/Team.java b/src/main/java/com/merge/api/ticketing/types/Team.java index c22e14db1..7896b07b0 100644 --- a/src/main/java/com/merge/api/ticketing/types/Team.java +++ b/src/main/java/com/merge/api/ticketing/types/Team.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -74,8 +77,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -98,16 +104,22 @@ public Optional getModifiedAt() { /** * @return The team's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The team's description. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -119,13 +131,49 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -238,6 +286,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

              The datetime that this object was created by Merge.

              */ @@ -280,6 +339,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

              The team's description.

              */ @@ -294,6 +364,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + 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.

              */ @@ -319,6 +400,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -330,6 +422,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public Team build() { return new Team( id, 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..a641494f7 100644 --- a/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TeamsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -143,8 +146,17 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { return remoteId; } @@ -377,6 +389,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + public TeamsListRequest build() { return new TeamsListRequest( createdAfter, 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..e69af26a7 100644 --- a/src/main/java/com/merge/api/ticketing/types/Ticket.java +++ b/src/main/java/com/merge/api/ticketing/types/Ticket.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -154,8 +157,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -178,8 +184,11 @@ public Optional getModifiedAt() { /** * @return The ticket's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -202,16 +211,22 @@ public Optional>> getAssignedTeams() { /** * @return The user who created this ticket. */ - @JsonProperty("creator") + @JsonIgnore public Optional getCreator() { + if (creator == null) { + return Optional.empty(); + } return creator; } /** * @return The ticket's due date. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -224,16 +239,22 @@ public Optional getDueDate() { *
            • ON_HOLD - ON_HOLD
            • *
            */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -248,32 +269,44 @@ public Optional>> getCollections() { /** * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. */ - @JsonProperty("ticket_type") + @JsonIgnore public Optional getTicketType() { + if (ticketType == null) { + return Optional.empty(); + } return ticketType; } /** * @return The account associated with the ticket. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact associated with the ticket. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The ticket's parent ticket. */ - @JsonProperty("parent_ticket") + @JsonIgnore public Optional getParentTicket() { + if (parentTicket == null) { + return Optional.empty(); + } return parentTicket; } @@ -291,8 +324,11 @@ public Optional>> getAttachments() { *
          • COLLECTION - COLLECTION
          • *
          */ - @JsonProperty("access_level") + @JsonIgnore public Optional getAccessLevel() { + if (accessLevel == null) { + return Optional.empty(); + } return accessLevel; } @@ -309,8 +345,11 @@ public Optional>> getRoles() { /** * @return The 3rd party url of the Ticket. */ - @JsonProperty("ticket_url") + @JsonIgnore public Optional getTicketUrl() { + if (ticketUrl == null) { + return Optional.empty(); + } return ticketUrl; } @@ -323,32 +362,44 @@ public Optional getTicketUrl() { *
        • LOW - LOW
        • *
        */ - @JsonProperty("priority") + @JsonIgnore public Optional getPriority() { + if (priority == null) { + return Optional.empty(); + } return priority; } /** * @return When the third party's ticket was created. */ - @JsonProperty("remote_created_at") + @JsonIgnore public Optional getRemoteCreatedAt() { + if (remoteCreatedAt == null) { + return Optional.empty(); + } return remoteCreatedAt; } /** * @return When the third party's ticket was updated. */ - @JsonProperty("remote_updated_at") + @JsonIgnore public Optional getRemoteUpdatedAt() { + if (remoteUpdatedAt == null) { + return Optional.empty(); + } return remoteUpdatedAt; } /** * @return When the ticket was completed. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } return completedAt; } @@ -360,13 +411,19 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } return remoteData; } @@ -375,6 +432,114 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("creator") + private Optional _getCreator() { + return creator; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_type") + private Optional _getTicketType() { + return ticketType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_ticket") + private Optional _getParentTicket() { + return parentTicket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("access_level") + private Optional _getAccessLevel() { + return accessLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_url") + private Optional _getTicketUrl() { + return ticketUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("priority") + private Optional _getPriority() { + return priority; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_at") + private Optional _getRemoteCreatedAt() { + return remoteCreatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_at") + private Optional _getRemoteUpdatedAt() { + return remoteUpdatedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { + return remoteData; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -584,6 +749,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -626,6 +802,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        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.

        */ @@ -668,6 +855,17 @@ public Builder creator(TicketCreator creator) { return this; } + public Builder creator(Nullable creator) { + if (creator.isNull()) { + this.creator = null; + } else if (creator.isEmpty()) { + this.creator = Optional.empty(); + } else { + this.creator = Optional.of(creator.get()); + } + return this; + } + /** *

        The ticket's due date.

        */ @@ -682,6 +880,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

        The current status of the ticket.

        *
          @@ -702,6 +911,17 @@ public Builder status(TicketStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

          The ticket’s description. HTML version of description is mapped if supported by the third-party platform.

          */ @@ -716,6 +936,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

          The Collections that this Ticket is included in.

          */ @@ -744,6 +975,17 @@ public Builder ticketType(String ticketType) { return this; } + public Builder ticketType(Nullable ticketType) { + if (ticketType.isNull()) { + this.ticketType = null; + } else if (ticketType.isEmpty()) { + this.ticketType = Optional.empty(); + } else { + this.ticketType = Optional.of(ticketType.get()); + } + return this; + } + /** *

          The account associated with the ticket.

          */ @@ -758,6 +1000,17 @@ public Builder account(TicketAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

          The contact associated with the ticket.

          */ @@ -772,6 +1025,17 @@ public Builder contact(TicketContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

          The ticket's parent ticket.

          */ @@ -786,6 +1050,17 @@ public Builder parentTicket(TicketParentTicket parentTicket) { return this; } + public Builder parentTicket(Nullable parentTicket) { + if (parentTicket.isNull()) { + this.parentTicket = null; + } else if (parentTicket.isEmpty()) { + this.parentTicket = Optional.empty(); + } else { + this.parentTicket = Optional.of(parentTicket.get()); + } + return this; + } + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) public Builder attachments(Optional>> attachments) { this.attachments = attachments; @@ -817,6 +1092,17 @@ public Builder accessLevel(TicketAccessLevel accessLevel) { return this; } + public Builder accessLevel(Nullable accessLevel) { + if (accessLevel.isNull()) { + this.accessLevel = null; + } else if (accessLevel.isEmpty()) { + this.accessLevel = Optional.empty(); + } else { + this.accessLevel = Optional.of(accessLevel.get()); + } + return this; + } + @JsonSetter(value = "tags", nulls = Nulls.SKIP) public Builder tags(Optional>> tags) { this.tags = tags; @@ -853,6 +1139,17 @@ public Builder ticketUrl(String ticketUrl) { return this; } + public Builder ticketUrl(Nullable ticketUrl) { + if (ticketUrl.isNull()) { + this.ticketUrl = null; + } else if (ticketUrl.isEmpty()) { + this.ticketUrl = Optional.empty(); + } else { + this.ticketUrl = Optional.of(ticketUrl.get()); + } + return this; + } + /** *

          The priority or urgency of the Ticket.

          *
            @@ -873,6 +1170,17 @@ public Builder priority(TicketPriority priority) { return this; } + public Builder priority(Nullable priority) { + if (priority.isNull()) { + this.priority = null; + } else if (priority.isEmpty()) { + this.priority = Optional.empty(); + } else { + this.priority = Optional.of(priority.get()); + } + return this; + } + /** *

            When the third party's ticket was created.

            */ @@ -887,6 +1195,17 @@ public Builder remoteCreatedAt(OffsetDateTime remoteCreatedAt) { return this; } + public Builder remoteCreatedAt(Nullable remoteCreatedAt) { + if (remoteCreatedAt.isNull()) { + this.remoteCreatedAt = null; + } else if (remoteCreatedAt.isEmpty()) { + this.remoteCreatedAt = Optional.empty(); + } else { + this.remoteCreatedAt = Optional.of(remoteCreatedAt.get()); + } + return this; + } + /** *

            When the third party's ticket was updated.

            */ @@ -901,6 +1220,17 @@ public Builder remoteUpdatedAt(OffsetDateTime remoteUpdatedAt) { return this; } + public Builder remoteUpdatedAt(Nullable remoteUpdatedAt) { + if (remoteUpdatedAt.isNull()) { + this.remoteUpdatedAt = null; + } else if (remoteUpdatedAt.isEmpty()) { + this.remoteUpdatedAt = Optional.empty(); + } else { + this.remoteUpdatedAt = Optional.of(remoteUpdatedAt.get()); + } + return this; + } + /** *

            When the ticket was completed.

            */ @@ -915,6 +1245,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + 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.

            */ @@ -940,6 +1281,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -951,6 +1303,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; diff --git a/src/main/java/com/merge/api/ticketing/types/TicketRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketRequest.java index 848d44881..0a19b63dd 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketRequest.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -121,8 +124,11 @@ private TicketRequest( /** * @return The ticket's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -145,16 +151,22 @@ public Optional>> getAssignedTeams /** * @return The user who created this ticket. */ - @JsonProperty("creator") + @JsonIgnore public Optional getCreator() { + if (creator == null) { + return Optional.empty(); + } return creator; } /** * @return The ticket's due date. */ - @JsonProperty("due_date") + @JsonIgnore public Optional getDueDate() { + if (dueDate == null) { + return Optional.empty(); + } return dueDate; } @@ -167,16 +179,22 @@ public Optional getDueDate() { *
          • ON_HOLD - ON_HOLD
          • *
          */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } /** * @return The ticket’s description. HTML version of description is mapped if supported by the third-party platform. */ - @JsonProperty("description") + @JsonIgnore public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } return description; } @@ -191,32 +209,44 @@ public Optional>> getCollections() { /** * @return The sub category of the ticket within the 3rd party system. Examples include incident, task, subtask or to-do. */ - @JsonProperty("ticket_type") + @JsonIgnore public Optional getTicketType() { + if (ticketType == null) { + return Optional.empty(); + } return ticketType; } /** * @return The account associated with the ticket. */ - @JsonProperty("account") + @JsonIgnore public Optional getAccount() { + if (account == null) { + return Optional.empty(); + } return account; } /** * @return The contact associated with the ticket. */ - @JsonProperty("contact") + @JsonIgnore public Optional getContact() { + if (contact == null) { + return Optional.empty(); + } return contact; } /** * @return The ticket's parent ticket. */ - @JsonProperty("parent_ticket") + @JsonIgnore public Optional getParentTicket() { + if (parentTicket == null) { + return Optional.empty(); + } return parentTicket; } @@ -234,8 +264,11 @@ public Optional>> getAttachments() { *
        • COLLECTION - COLLECTION
        • *
        */ - @JsonProperty("access_level") + @JsonIgnore public Optional getAccessLevel() { + if (accessLevel == null) { + return Optional.empty(); + } return accessLevel; } @@ -252,16 +285,22 @@ public Optional>> getRoles() { /** * @return When the ticket was completed. */ - @JsonProperty("completed_at") + @JsonIgnore public Optional getCompletedAt() { + if (completedAt == null) { + return Optional.empty(); + } return completedAt; } /** * @return The 3rd party url of the Ticket. */ - @JsonProperty("ticket_url") + @JsonIgnore public Optional getTicketUrl() { + if (ticketUrl == null) { + return Optional.empty(); + } return ticketUrl; } @@ -274,18 +313,27 @@ public Optional getTicketUrl() { *
      • LOW - LOW
      • *
      */ - @JsonProperty("priority") + @JsonIgnore public Optional getPriority() { + if (priority == null) { + return Optional.empty(); + } return priority; } - @JsonProperty("integration_params") + @JsonIgnore public Optional> getIntegrationParams() { + if (integrationParams == null) { + return Optional.empty(); + } return integrationParams; } - @JsonProperty("linked_account_params") + @JsonIgnore public Optional> getLinkedAccountParams() { + if (linkedAccountParams == null) { + return Optional.empty(); + } return linkedAccountParams; } @@ -294,6 +342,96 @@ public Optional> getRemoteFields() { return remoteFields; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("creator") + private Optional _getCreator() { + return creator; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_date") + private Optional _getDueDate() { + return dueDate; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_type") + private Optional _getTicketType() { + return ticketType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("contact") + private Optional _getContact() { + return contact; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("parent_ticket") + private Optional _getParentTicket() { + return parentTicket; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("access_level") + private Optional _getAccessLevel() { + return accessLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_at") + private Optional _getCompletedAt() { + return completedAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_url") + private Optional _getTicketUrl() { + return ticketUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("priority") + private Optional _getPriority() { + return priority; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("integration_params") + private Optional> _getIntegrationParams() { + return integrationParams; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("linked_account_params") + private Optional> _getLinkedAccountParams() { + return linkedAccountParams; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -457,6 +595,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

      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.

      */ @@ -499,6 +648,17 @@ public Builder creator(TicketRequestCreator creator) { return this; } + public Builder creator(Nullable creator) { + if (creator.isNull()) { + this.creator = null; + } else if (creator.isEmpty()) { + this.creator = Optional.empty(); + } else { + this.creator = Optional.of(creator.get()); + } + return this; + } + /** *

      The ticket's due date.

      */ @@ -513,6 +673,17 @@ public Builder dueDate(OffsetDateTime dueDate) { return this; } + public Builder dueDate(Nullable dueDate) { + if (dueDate.isNull()) { + this.dueDate = null; + } else if (dueDate.isEmpty()) { + this.dueDate = Optional.empty(); + } else { + this.dueDate = Optional.of(dueDate.get()); + } + return this; + } + /** *

      The current status of the ticket.

      *
        @@ -533,6 +704,17 @@ public Builder status(TicketRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

        The ticket’s description. HTML version of description is mapped if supported by the third-party platform.

        */ @@ -547,6 +729,17 @@ public Builder description(String description) { return this; } + public Builder description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + /** *

        The Collections that this Ticket is included in.

        */ @@ -575,6 +768,17 @@ public Builder ticketType(String ticketType) { return this; } + public Builder ticketType(Nullable ticketType) { + if (ticketType.isNull()) { + this.ticketType = null; + } else if (ticketType.isEmpty()) { + this.ticketType = Optional.empty(); + } else { + this.ticketType = Optional.of(ticketType.get()); + } + return this; + } + /** *

        The account associated with the ticket.

        */ @@ -589,6 +793,17 @@ public Builder account(TicketRequestAccount account) { return this; } + public Builder account(Nullable account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + /** *

        The contact associated with the ticket.

        */ @@ -603,6 +818,17 @@ public Builder contact(TicketRequestContact contact) { return this; } + public Builder contact(Nullable contact) { + if (contact.isNull()) { + this.contact = null; + } else if (contact.isEmpty()) { + this.contact = Optional.empty(); + } else { + this.contact = Optional.of(contact.get()); + } + return this; + } + /** *

        The ticket's parent ticket.

        */ @@ -617,6 +843,17 @@ public Builder parentTicket(TicketRequestParentTicket parentTicket) { return this; } + public Builder parentTicket(Nullable parentTicket) { + if (parentTicket.isNull()) { + this.parentTicket = null; + } else if (parentTicket.isEmpty()) { + this.parentTicket = Optional.empty(); + } else { + this.parentTicket = Optional.of(parentTicket.get()); + } + return this; + } + @JsonSetter(value = "attachments", nulls = Nulls.SKIP) public Builder attachments(Optional>> attachments) { this.attachments = attachments; @@ -648,6 +885,17 @@ public Builder accessLevel(TicketRequestAccessLevel accessLevel) { return this; } + public Builder accessLevel(Nullable accessLevel) { + if (accessLevel.isNull()) { + this.accessLevel = null; + } else if (accessLevel.isEmpty()) { + this.accessLevel = Optional.empty(); + } else { + this.accessLevel = Optional.of(accessLevel.get()); + } + return this; + } + @JsonSetter(value = "tags", nulls = Nulls.SKIP) public Builder tags(Optional>> tags) { this.tags = tags; @@ -684,6 +932,17 @@ public Builder completedAt(OffsetDateTime completedAt) { return this; } + public Builder completedAt(Nullable completedAt) { + if (completedAt.isNull()) { + this.completedAt = null; + } else if (completedAt.isEmpty()) { + this.completedAt = Optional.empty(); + } else { + this.completedAt = Optional.of(completedAt.get()); + } + return this; + } + /** *

        The 3rd party url of the Ticket.

        */ @@ -698,6 +957,17 @@ public Builder ticketUrl(String ticketUrl) { return this; } + public Builder ticketUrl(Nullable ticketUrl) { + if (ticketUrl.isNull()) { + this.ticketUrl = null; + } else if (ticketUrl.isEmpty()) { + this.ticketUrl = Optional.empty(); + } else { + this.ticketUrl = Optional.of(ticketUrl.get()); + } + return this; + } + /** *

        The priority or urgency of the Ticket.

        *
          @@ -718,6 +988,17 @@ public Builder priority(TicketRequestPriority priority) { return this; } + public Builder priority(Nullable priority) { + if (priority.isNull()) { + this.priority = null; + } else if (priority.isEmpty()) { + this.priority = Optional.empty(); + } else { + this.priority = Optional.of(priority.get()); + } + return this; + } + @JsonSetter(value = "integration_params", nulls = Nulls.SKIP) public Builder integrationParams(Optional> integrationParams) { this.integrationParams = integrationParams; @@ -729,6 +1010,17 @@ public Builder integrationParams(Map integrationParams) { return this; } + public Builder integrationParams(Nullable> integrationParams) { + if (integrationParams.isNull()) { + this.integrationParams = null; + } else if (integrationParams.isEmpty()) { + this.integrationParams = Optional.empty(); + } else { + this.integrationParams = Optional.of(integrationParams.get()); + } + return this; + } + @JsonSetter(value = "linked_account_params", nulls = Nulls.SKIP) public Builder linkedAccountParams(Optional> linkedAccountParams) { this.linkedAccountParams = linkedAccountParams; @@ -740,6 +1032,17 @@ public Builder linkedAccountParams(Map linkedAccountParams) { return this; } + public Builder linkedAccountParams(Nullable> linkedAccountParams) { + if (linkedAccountParams.isNull()) { + this.linkedAccountParams = null; + } else if (linkedAccountParams.isEmpty()) { + this.linkedAccountParams = Optional.empty(); + } else { + this.linkedAccountParams = Optional.of(linkedAccountParams.get()); + } + return this; + } + @JsonSetter(value = "remote_fields", nulls = Nulls.SKIP) public Builder remoteFields(Optional> remoteFields) { this.remoteFields = remoteFields; 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..e1acd8627 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -205,16 +208,22 @@ public Optional getCollectionIds() { /** * @return If provided, will only return tickets completed after this datetime. */ - @JsonProperty("completed_after") + @JsonIgnore public Optional getCompletedAfter() { + if (completedAfter == null) { + return Optional.empty(); + } return completedAfter; } /** * @return If provided, will only return tickets completed before this datetime. */ - @JsonProperty("completed_before") + @JsonIgnore public Optional getCompletedBefore() { + if (completedBefore == null) { + return Optional.empty(); + } return completedBefore; } @@ -269,16 +278,22 @@ public Optional getCursor() { /** * @return If provided, will only return tickets due after this datetime. */ - @JsonProperty("due_after") + @JsonIgnore public Optional getDueAfter() { + if (dueAfter == null) { + return Optional.empty(); + } return dueAfter; } /** * @return If provided, will only return tickets due before this datetime. */ - @JsonProperty("due_before") + @JsonIgnore public Optional getDueBefore() { + if (dueBefore == null) { + return Optional.empty(); + } return dueBefore; } @@ -333,8 +348,11 @@ public Optional getModifiedBefore() { /** * @return If provided, will only return tickets with this name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } @@ -363,24 +381,33 @@ public Optional getParentTicketId() { *
        • LOW - LOW
        • *
        */ - @JsonProperty("priority") + @JsonIgnore public Optional getPriority() { + if (priority == null) { + return Optional.empty(); + } return priority; } /** * @return If provided, will only return tickets created in the third party platform after this datetime. */ - @JsonProperty("remote_created_after") + @JsonIgnore public Optional getRemoteCreatedAfter() { + if (remoteCreatedAfter == null) { + return Optional.empty(); + } return remoteCreatedAfter; } /** * @return If provided, will only return tickets created in the third party platform before this datetime. */ - @JsonProperty("remote_created_before") + @JsonIgnore public Optional getRemoteCreatedBefore() { + if (remoteCreatedBefore == null) { + return Optional.empty(); + } return remoteCreatedBefore; } @@ -395,24 +422,33 @@ public Optional getRemoteFields() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } /** * @return If provided, will only return tickets updated in the third party platform after this datetime. */ - @JsonProperty("remote_updated_after") + @JsonIgnore public Optional getRemoteUpdatedAfter() { + if (remoteUpdatedAfter == null) { + return Optional.empty(); + } return remoteUpdatedAfter; } /** * @return If provided, will only return tickets updated in the third party platform before this datetime. */ - @JsonProperty("remote_updated_before") + @JsonIgnore public Optional getRemoteUpdatedBefore() { + if (remoteUpdatedBefore == null) { + return Optional.empty(); + } return remoteUpdatedBefore; } @@ -427,8 +463,11 @@ public Optional getShowEnumOrigins() { /** * @return If provided, will only return tickets of this status. */ - @JsonProperty("status") + @JsonIgnore public Optional getStatus() { + if (status == null) { + return Optional.empty(); + } return status; } @@ -443,16 +482,106 @@ public Optional getTags() { /** * @return If provided, will only return tickets of this type. */ - @JsonProperty("ticket_type") + @JsonIgnore public Optional getTicketType() { + if (ticketType == null) { + return Optional.empty(); + } return ticketType; } /** * @return If provided, will only return tickets where the URL matches or contains the substring */ - @JsonProperty("ticket_url") + @JsonIgnore public Optional getTicketUrl() { + if (ticketUrl == null) { + return Optional.empty(); + } + return ticketUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_after") + private Optional _getCompletedAfter() { + return completedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("completed_before") + private Optional _getCompletedBefore() { + return completedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_after") + private Optional _getDueAfter() { + return dueAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("due_before") + private Optional _getDueBefore() { + return dueBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("priority") + private Optional _getPriority() { + return priority; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_after") + private Optional _getRemoteCreatedAfter() { + return remoteCreatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_created_before") + private Optional _getRemoteCreatedBefore() { + return remoteCreatedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_after") + private Optional _getRemoteUpdatedAfter() { + return remoteUpdatedAfter; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_updated_before") + private Optional _getRemoteUpdatedBefore() { + return remoteUpdatedBefore; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("status") + private Optional _getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_type") + private Optional _getTicketType() { + return ticketType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("ticket_url") + private Optional _getTicketUrl() { return ticketUrl; } @@ -745,6 +874,17 @@ public Builder completedAfter(OffsetDateTime completedAfter) { return this; } + public Builder completedAfter(Nullable completedAfter) { + if (completedAfter.isNull()) { + this.completedAfter = null; + } else if (completedAfter.isEmpty()) { + this.completedAfter = Optional.empty(); + } else { + this.completedAfter = Optional.of(completedAfter.get()); + } + return this; + } + /** *

        If provided, will only return tickets completed before this datetime.

        */ @@ -759,6 +899,17 @@ public Builder completedBefore(OffsetDateTime completedBefore) { return this; } + public Builder completedBefore(Nullable completedBefore) { + if (completedBefore.isNull()) { + this.completedBefore = null; + } else if (completedBefore.isEmpty()) { + this.completedBefore = Optional.empty(); + } else { + this.completedBefore = Optional.of(completedBefore.get()); + } + return this; + } + /** *

        If provided, will only return tickets for this contact.

        */ @@ -857,6 +1008,17 @@ public Builder dueAfter(OffsetDateTime dueAfter) { return this; } + public Builder dueAfter(Nullable dueAfter) { + if (dueAfter.isNull()) { + this.dueAfter = null; + } else if (dueAfter.isEmpty()) { + this.dueAfter = Optional.empty(); + } else { + this.dueAfter = Optional.of(dueAfter.get()); + } + return this; + } + /** *

        If provided, will only return tickets due before this datetime.

        */ @@ -871,6 +1033,17 @@ public Builder dueBefore(OffsetDateTime dueBefore) { return this; } + public Builder dueBefore(Nullable dueBefore) { + if (dueBefore.isNull()) { + this.dueBefore = null; + } else if (dueBefore.isEmpty()) { + this.dueBefore = Optional.empty(); + } else { + this.dueBefore = Optional.of(dueBefore.get()); + } + 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.

        */ @@ -969,6 +1142,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ @@ -1017,6 +1201,17 @@ public Builder priority(TicketsListRequestPriority priority) { return this; } + public Builder priority(Nullable priority) { + if (priority.isNull()) { + this.priority = null; + } else if (priority.isEmpty()) { + this.priority = Optional.empty(); + } else { + this.priority = Optional.of(priority.get()); + } + return this; + } + /** *

        If provided, will only return tickets created in the third party platform after this datetime.

        */ @@ -1031,6 +1226,17 @@ public Builder remoteCreatedAfter(OffsetDateTime remoteCreatedAfter) { return this; } + public Builder remoteCreatedAfter(Nullable remoteCreatedAfter) { + if (remoteCreatedAfter.isNull()) { + this.remoteCreatedAfter = null; + } else if (remoteCreatedAfter.isEmpty()) { + this.remoteCreatedAfter = Optional.empty(); + } else { + this.remoteCreatedAfter = Optional.of(remoteCreatedAfter.get()); + } + return this; + } + /** *

        If provided, will only return tickets created in the third party platform before this datetime.

        */ @@ -1045,6 +1251,17 @@ public Builder remoteCreatedBefore(OffsetDateTime remoteCreatedBefore) { return this; } + public Builder remoteCreatedBefore(Nullable remoteCreatedBefore) { + if (remoteCreatedBefore.isNull()) { + this.remoteCreatedBefore = null; + } else if (remoteCreatedBefore.isEmpty()) { + this.remoteCreatedBefore = Optional.empty(); + } else { + this.remoteCreatedBefore = Optional.of(remoteCreatedBefore.get()); + } + return this; + } + /** *

        Deprecated. Use show_enum_origins.

        */ @@ -1073,6 +1290,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        If provided, will only return tickets updated in the third party platform after this datetime.

        */ @@ -1087,6 +1315,17 @@ public Builder remoteUpdatedAfter(OffsetDateTime remoteUpdatedAfter) { return this; } + public Builder remoteUpdatedAfter(Nullable remoteUpdatedAfter) { + if (remoteUpdatedAfter.isNull()) { + this.remoteUpdatedAfter = null; + } else if (remoteUpdatedAfter.isEmpty()) { + this.remoteUpdatedAfter = Optional.empty(); + } else { + this.remoteUpdatedAfter = Optional.of(remoteUpdatedAfter.get()); + } + return this; + } + /** *

        If provided, will only return tickets updated in the third party platform before this datetime.

        */ @@ -1101,6 +1340,17 @@ public Builder remoteUpdatedBefore(OffsetDateTime remoteUpdatedBefore) { return this; } + public Builder remoteUpdatedBefore(Nullable remoteUpdatedBefore) { + if (remoteUpdatedBefore.isNull()) { + this.remoteUpdatedBefore = null; + } else if (remoteUpdatedBefore.isEmpty()) { + this.remoteUpdatedBefore = Optional.empty(); + } else { + this.remoteUpdatedBefore = Optional.of(remoteUpdatedBefore.get()); + } + 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

        */ @@ -1129,6 +1379,17 @@ public Builder status(TicketsListRequestStatus status) { return this; } + public Builder status(Nullable status) { + if (status.isNull()) { + this.status = null; + } else if (status.isEmpty()) { + this.status = Optional.empty(); + } else { + this.status = Optional.of(status.get()); + } + return this; + } + /** *

        If provided, will only return tickets matching the tags; multiple tags can be separated by commas.

        */ @@ -1157,6 +1418,17 @@ public Builder ticketType(String ticketType) { return this; } + public Builder ticketType(Nullable ticketType) { + if (ticketType.isNull()) { + this.ticketType = null; + } else if (ticketType.isEmpty()) { + this.ticketType = Optional.empty(); + } else { + this.ticketType = Optional.of(ticketType.get()); + } + return this; + } + /** *

        If provided, will only return tickets where the URL matches or contains the substring

        */ @@ -1171,6 +1443,17 @@ public Builder ticketUrl(String ticketUrl) { return this; } + public Builder ticketUrl(Nullable ticketUrl) { + if (ticketUrl.isNull()) { + this.ticketUrl = null; + } else if (ticketUrl.isEmpty()) { + this.ticketUrl = Optional.empty(); + } else { + this.ticketUrl = Optional.of(ticketUrl.get()); + } + return this; + } + public TicketsListRequest build() { return new TicketsListRequest( expand, diff --git a/src/main/java/com/merge/api/ticketing/types/TicketsMetaPatchRetrieveRequest.java b/src/main/java/com/merge/api/ticketing/types/TicketsMetaPatchRetrieveRequest.java new file mode 100644 index 000000000..b300398df --- /dev/null +++ b/src/main/java/com/merge/api/ticketing/types/TicketsMetaPatchRetrieveRequest.java @@ -0,0 +1,59 @@ +/** + * 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.databind.annotation.JsonDeserialize; +import com.merge.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = TicketsMetaPatchRetrieveRequest.Builder.class) +public final class TicketsMetaPatchRetrieveRequest { + private final Map additionalProperties; + + private TicketsMetaPatchRetrieveRequest(Map additionalProperties) { + this.additionalProperties = additionalProperties; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof TicketsMetaPatchRetrieveRequest; + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + @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 { + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(TicketsMetaPatchRetrieveRequest other) { + return this; + } + + public TicketsMetaPatchRetrieveRequest build() { + return new TicketsMetaPatchRetrieveRequest(additionalProperties); + } + } +} 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..25a7c433b 100644 --- a/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/TicketsRemoteFieldClassesListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.util.HashMap; import java.util.Map; @@ -102,16 +105,22 @@ public Optional getIncludeShellData() { /** * @return If provided, will only return remote field classes with this is_common_model_field value */ - @JsonProperty("is_common_model_field") + @JsonIgnore public Optional getIsCommonModelField() { + if (isCommonModelField == null) { + return Optional.empty(); + } return isCommonModelField; } /** * @return If provided, will only return remote fields classes with this is_custom value */ - @JsonProperty("is_custom") + @JsonIgnore public Optional getIsCustom() { + if (isCustom == null) { + return Optional.empty(); + } return isCustom; } @@ -123,6 +132,18 @@ public Optional getPageSize() { return pageSize; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_common_model_field") + private Optional _getIsCommonModelField() { + return isCommonModelField; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_custom") + private Optional _getIsCustom() { + return isCustom; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -287,6 +308,17 @@ public Builder isCommonModelField(Boolean isCommonModelField) { return this; } + public Builder isCommonModelField(Nullable isCommonModelField) { + if (isCommonModelField.isNull()) { + this.isCommonModelField = null; + } else if (isCommonModelField.isEmpty()) { + this.isCommonModelField = Optional.empty(); + } else { + this.isCommonModelField = Optional.of(isCommonModelField.get()); + } + return this; + } + /** *

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

        */ @@ -301,6 +333,17 @@ public Builder isCustom(Boolean isCustom) { return this; } + public Builder isCustom(Nullable isCustom) { + if (isCustom.isNull()) { + this.isCustom = null; + } else if (isCustom.isEmpty()) { + this.isCustom = Optional.empty(); + } else { + this.isCustom = Optional.of(isCustom.get()); + } + return this; + } + /** *

        Number of results to return per page.

        */ diff --git a/src/main/java/com/merge/api/ticketing/types/User.java b/src/main/java/com/merge/api/ticketing/types/User.java index be183429f..15f4cd1b5 100644 --- a/src/main/java/com/merge/api/ticketing/types/User.java +++ b/src/main/java/com/merge/api/ticketing/types/User.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -12,6 +13,8 @@ import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.merge.api.core.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -90,8 +93,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -114,24 +120,33 @@ public Optional getModifiedAt() { /** * @return The user's name. */ - @JsonProperty("name") + @JsonIgnore public Optional getName() { + if (name == null) { + return Optional.empty(); + } return name; } /** * @return The user's email address. */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } /** * @return Whether or not the user is active. */ - @JsonProperty("is_active") + @JsonIgnore public Optional getIsActive() { + if (isActive == null) { + return Optional.empty(); + } return isActive; } @@ -148,8 +163,11 @@ public Optional>> getRoles() { /** * @return The user's avatar picture. */ - @JsonProperty("avatar") + @JsonIgnore public Optional getAvatar() { + if (avatar == null) { + return Optional.empty(); + } return avatar; } @@ -161,13 +179,61 @@ public Optional getRemoteWasDeleted() { return remoteWasDeleted; } - @JsonProperty("field_mappings") + @JsonIgnore public Optional> getFieldMappings() { + if (fieldMappings == null) { + return Optional.empty(); + } return fieldMappings; } - @JsonProperty("remote_data") + @JsonIgnore public Optional> getRemoteData() { + if (remoteData == null) { + return Optional.empty(); + } + return remoteData; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("name") + private Optional _getName() { + return name; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("is_active") + private Optional _getIsActive() { + return isActive; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("avatar") + private Optional _getAvatar() { + return avatar; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("field_mappings") + private Optional> _getFieldMappings() { + return fieldMappings; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_data") + private Optional> _getRemoteData() { return remoteData; } @@ -300,6 +366,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -342,6 +419,17 @@ public Builder name(String name) { return this; } + public Builder name(Nullable name) { + if (name.isNull()) { + this.name = null; + } else if (name.isEmpty()) { + this.name = Optional.empty(); + } else { + this.name = Optional.of(name.get()); + } + return this; + } + /** *

        The user's email address.

        */ @@ -356,6 +444,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + return this; + } + /** *

        Whether or not the user is active.

        */ @@ -370,6 +469,17 @@ public Builder isActive(Boolean isActive) { return this; } + public Builder isActive(Nullable isActive) { + if (isActive.isNull()) { + this.isActive = null; + } else if (isActive.isEmpty()) { + this.isActive = Optional.empty(); + } else { + this.isActive = Optional.of(isActive.get()); + } + return this; + } + @JsonSetter(value = "teams", nulls = Nulls.SKIP) public Builder teams(Optional>> teams) { this.teams = teams; @@ -406,6 +516,17 @@ public Builder avatar(String avatar) { return this; } + public Builder avatar(Nullable avatar) { + if (avatar.isNull()) { + this.avatar = null; + } else if (avatar.isEmpty()) { + this.avatar = Optional.empty(); + } else { + this.avatar = Optional.of(avatar.get()); + } + 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.

        */ @@ -431,6 +552,17 @@ public Builder fieldMappings(Map fieldMappings) { return this; } + public Builder fieldMappings(Nullable> fieldMappings) { + if (fieldMappings.isNull()) { + this.fieldMappings = null; + } else if (fieldMappings.isEmpty()) { + this.fieldMappings = Optional.empty(); + } else { + this.fieldMappings = Optional.of(fieldMappings.get()); + } + return this; + } + @JsonSetter(value = "remote_data", nulls = Nulls.SKIP) public Builder remoteData(Optional> remoteData) { this.remoteData = remoteData; @@ -442,6 +574,17 @@ public Builder remoteData(List remoteData) { return this; } + public Builder remoteData(Nullable> remoteData) { + if (remoteData.isNull()) { + this.remoteData = null; + } else if (remoteData.isEmpty()) { + this.remoteData = Optional.empty(); + } else { + this.remoteData = Optional.of(remoteData.get()); + } + return this; + } + public User build() { return new User( id, 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..1a1dc1dc2 100644 --- a/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java +++ b/src/main/java/com/merge/api/ticketing/types/UsersListRequest.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.Collections; @@ -117,8 +120,11 @@ public Optional getCursor() { /** * @return If provided, will only return users with emails equal to this value (case insensitive). */ - @JsonProperty("email_address") + @JsonIgnore public Optional getEmailAddress() { + if (emailAddress == null) { + return Optional.empty(); + } return emailAddress; } @@ -173,8 +179,11 @@ public Optional getPageSize() { /** * @return The API provider's ID for the given object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -186,6 +195,18 @@ public Optional getTeam() { return team; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("email_address") + private Optional _getEmailAddress() { + return emailAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -365,6 +386,17 @@ public Builder emailAddress(String emailAddress) { return this; } + public Builder emailAddress(Nullable emailAddress) { + if (emailAddress.isNull()) { + this.emailAddress = null; + } else if (emailAddress.isEmpty()) { + this.emailAddress = Optional.empty(); + } else { + this.emailAddress = Optional.of(emailAddress.get()); + } + 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.

        */ @@ -463,6 +495,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        If provided, will only return users matching in this team.

        */ diff --git a/src/main/java/com/merge/api/ticketing/types/Viewer.java b/src/main/java/com/merge/api/ticketing/types/Viewer.java index f7ed4b978..9f824d9bd 100644 --- a/src/main/java/com/merge/api/ticketing/types/Viewer.java +++ b/src/main/java/com/merge/api/ticketing/types/Viewer.java @@ -5,12 +5,15 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; 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.Nullable; +import com.merge.api.core.NullableNonemptyFilter; import com.merge.api.core.ObjectMappers; import java.time.OffsetDateTime; import java.util.HashMap; @@ -60,8 +63,11 @@ public Optional getId() { /** * @return The third-party API ID of the matching object. */ - @JsonProperty("remote_id") + @JsonIgnore public Optional getRemoteId() { + if (remoteId == null) { + return Optional.empty(); + } return remoteId; } @@ -84,16 +90,40 @@ public Optional getModifiedAt() { /** * @return The Team this Viewer belongs to. */ - @JsonProperty("team") + @JsonIgnore public Optional getTeam() { + if (team == null) { + return Optional.empty(); + } return team; } /** * @return The User this Viewer belongs to. */ - @JsonProperty("user") + @JsonIgnore public Optional getUser() { + if (user == null) { + return Optional.empty(); + } + return user; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("remote_id") + private Optional _getRemoteId() { + return remoteId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("team") + private Optional _getTeam() { + return team; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("user") + private Optional _getUser() { return user; } @@ -185,6 +215,17 @@ public Builder remoteId(String remoteId) { return this; } + public Builder remoteId(Nullable remoteId) { + if (remoteId.isNull()) { + this.remoteId = null; + } else if (remoteId.isEmpty()) { + this.remoteId = Optional.empty(); + } else { + this.remoteId = Optional.of(remoteId.get()); + } + return this; + } + /** *

        The datetime that this object was created by Merge.

        */ @@ -227,6 +268,17 @@ public Builder team(ViewerTeam team) { return this; } + public Builder team(Nullable team) { + if (team.isNull()) { + this.team = null; + } else if (team.isEmpty()) { + this.team = Optional.empty(); + } else { + this.team = Optional.of(team.get()); + } + return this; + } + /** *

        The User this Viewer belongs to.

        */ @@ -241,6 +293,17 @@ public Builder user(ViewerUser user) { return this; } + public Builder user(Nullable user) { + if (user.isNull()) { + this.user = null; + } else if (user.isEmpty()) { + this.user = Optional.empty(); + } else { + this.user = Optional.of(user.get()); + } + return this; + } + public Viewer build() { return new Viewer(id, remoteId, createdAt, modifiedAt, team, user, additionalProperties); }